Oh, I was thrown off by his "so you don't need to press a button for it to work" comment.
Yeah, parent PlayGui::onWake(%this) and call your function. Then as the last line of your function do something like cancel($myFunctionSched); $MyFunctionSched = schedule(500, 0, myFunction);
Then, parent PlayGui::onSleep(%this) and add in cancel($MyFunctionSched); to stop the loop from running when you're not looking at the play screen anymore (e.g. main menu).