I think this script doesn't work because the submit() function reloads the page. When the page is reloaded, all scripts die. The same thing happens if you open a new document in a window containing a script. All scripts exists in the document, not the window. That means no scripts can execute if the document they're on no longer exists.
Maybe you could try this instead:
in doit() (which I assume is in the popup) you call the setTimeout function from the parent instead. That way the code is executed from the parent and not the popup.
I'm not sure that works. Just make sure you store a reference to the popup with var reference_to_popup = window.open('mypage.htm')
Note that reference_to_popup must be a global variable or it won't be accessible from the popop.
Hope that helps.