in reply to Re^2: Auto-detecting module usage
in thread Auto-detecting module usage

So, all you have to do is go through all the scripts, and construct the list of modules they use. Fill a database table with that info, and then you can scan the reverse relations.