this is an impossible task. when you join a server, the only data sent to you is the data your client needs. you get the model data, datablocks, sounds, textures, etc. but you're never going to be sent server-sided scripts unless you specifically code infrastructure on the server side to make that happen. you can easily open up your cache.db file and extract all the models and stuff in there if you really want to, but you're going to have to do the code work yourself.
no matter how deep you go, the fact is that the server simply does not and will not voluntarily send over script information, because it has no reason to do so. really, the fact is that the vast majority of mods that you come across are public and open-source if you can figure out what they're called and find a working dl link. i'm assuming, though, that this is just for that private minority, and then i would contend that you don't have any right to other people's code if they don't want to release it.