Scripting OS 9 & OS X

When running a script that interacts with both os 9 and OSX applications, the script seems to hang in the OS 9 enviroment until you select the OS X desktop, has anyone any ideas why this may be running. The said script is running under an on idle handler an interacting with quark, photoshop 5 and MArkzwares flight Check.
Any pointers would be appreciated
Cheers
Steve