This is going to take some investigation. Until you get experience, this is where the great techs at camsoft are worth their weight in gold.
Why is your home switch on input 32? Should be on 1, 2, 3, or 4.
Try to replace the WAITUNTIL with a loop and message to make sure where you're at in the code.
IF #32=1 THEN MESSAGE In Loop:SLEEP 0.1:GOTO :LOOPTRIAL
MESSAGE Just finished Loop
Learn to read your Logfile. This takes a lot of study but once you're on to it, you can quickly diagnose most every logic error.
Keep in mind its something simple and stupid. I know this because it always is. Actually, not always. I found one really complex problem and proved it, ONCE. That's out of 100,000s of problems.