Modules is a NWN term, for BG2 you want mods. Of which the best are to found at
www.weidu.org (tactics, ascension, redemption, the imoen romance all are recommended) or
www.forgottenwars.net.
Writing your own scripts can be done with the software that comes with BG2, but your best off using the compiler that comes with Near Infinity - that will let you decompile existing scripts and let you have a look at working code.