I had an idea (a long time ago) before about developing a module that allowed you to create "virtual modules".
How this Virtual Module module would work is after installing/enabling it, you would use it to create a "virtual module" object to be stored in a table in the database. This table might contain virtual module id, the name of the virtual module, whether or not it is enabled, and possibly some other information. Then you would add code for any drupal hooks supported by the Virtual Module module, which would then be stored in another database table, associated with the "virtual module" you created. That table might contain a hook id, virtual module id, hook name, hook code, and whatever else might be deemed useful or necessary. Then when a hook in the Virtual Module module is called, it will check the database for any "virtual modules" that were created and enabled, and then run any associated hooks from the hook table using the eval() function.
Now this would be limited, since not all hooks could be supported in this way. It would also have some performance penalties by increasing database usage and running more code through eval().