WHILE switch = unpushed
WEND
This to me sounds like it is staying inside that loop until the switch is pressed

EDIT: nevermind I missed the IF Then Statement.