The best way to do it is with Tkinter, which has a neat "put-self-in-background" action. The attached file will do pretty much what you want, I think.... It has start and cancel buttons, but it seems to start immediately upon activation instead of when you hit the start button. The main point, though, is what happens when you hit Cancel: it stops dead. Look at the Update action to find the key for "self-in-background".
My python page
My ShareCG freebies