Are you doing anything in your while loop other than waiting for time to pass or the waitJoyButton condition? If not, it seems you could replace the while loop with something like:
Code:
yield viztask.waitAny( [ waitJoyButton, viztask.waitTime(10) ] )