Update: This thread is out of date! You can now get a reference to the top-level form by calling get_open_form().
get_open_form()
See this (newer) post for more info: