Putting this code in your loop should do the trick. I haven't tested it.
while(1) {
last unless DoOneEvent($TK_DONT_WAIT);
}
DoOneEvent is the routine called from MainLoop.
When passed the exported variable $TK_DONT_WAIT it returns true if there was an event to process, and false if otherwise. So DoOneEvent will continue to be called until there are no more events pending (and the only event pending would be the updating of your status bar). Then your program would continue on where it left off.
Read more about the main loop
here.