As mentioned in the comments, I tried sticking if async_has_finished right here, but for some reason it's much faster to have the if preempt calling gui.eval_block.

If I could put the if statement here, I wouldn't need to use a global variable!