First of all, you must tell which mod you want to install because some of them have different method of extraction but usually the mod must be extracted on CS2D folder while other modifications have CS2D itself in the mod so there's not necessary to extract it (for example Half-Life 2D by @ useigor has CS2D in this mod).
If you mean a Lua script, then here are the tips: First, go to your cs2d folder. Go to sys/lua. Replace your script/"mod" there. Open a file named server.lua. Put this following command:
@ THEMUD: Well, the mods doesn't requie to write the dofile to and usually the modification of CS2D must be extracted only.
And he doesn't mean about Lua Script (that's pretty obvious).