As correctly noted by RjOllos in the comments the common practice for TRAC modules is to subclass the Component
class. This will give you easy access to the current environment:
from trac.core import *
class MyModule(Component):
def createTicket(self):
return Ticket(self.env)
You can find more examples here.
As for the second part of your question. There is no central repository with every TRAC environment listed in it. Environments in TRAC are just directories with some particular files in them, so any directory on your hard drive can be a TRAC environment. You can try to identify such directories, checking for example if they contain a subdirectory conf with trac.ini file for example, or db subdirectory with trac.db file. You can read about environment folder structure here.
The best solution in your case is for the user to supply the path to an environment as a mandatory parameter for your external process to run. This exactly the case when you run TRAC - you also provide a path to a directory with an environment to run.