Nope no sense at all, (;-) You need to post teh entire script
Which sleep are you referreing to there are 2.
What I see from your piece of script is
You activate output1
Start a wait loop and sleep for 1.1 sec then continue
End the loop
Start another wait loop based on teh state of input1 IF not active then loop and
Sleep 50 ms between each loop .
When it finally sees teh signal from input1 then deactivate output1