It seems the question2answer importer was written for a case where there is an additional set of tables in the database for another app that was integrated with it. That is what the MAIN_APP_DB_NAME refers to.
We have done an import for a standalone q2a site recently and we have a modified version of the script which does not depend on this extra database. @RGJ was going to clean it up and submit it back in the next few weeks.