Good that you found a solution.
If I may, I'd like to offer some suggestions; This should be functionally equivalent to your command:
Begin Boolean Compare : [light] Equals False
Execute command, 'Toggle Lights' (by name) (and wait until it completes)
Set Boolean [light] to True
Play random sound (2 items)
Else
Play random sound (2 items)
Pause 1,5 seconds
Say, 'Shall I fix it ?' (and wait until it completes)
Write [Blue] 'Waiting for reply...' to log
Wait for spoken response: 'Yes;No'
Begin Text Compare : [~response] Has Not Been Set
Say, 'Take your time idiot !'
Else If Text Compare : [~response] Equals 'Yes'
Execute command, 'Toggle Lights' (by name) (and wait until it completes)
Say, 'Light state fixed.'
Set Boolean [light] to False
Else
Say, 'Canceled.'
End Condition
End Condition
Instead of explicitly setting "light" if it hasn't been set yet, you can check the "Evaluate 'Not Set' as false" option in the Begin action so that either "Not Set" or "False" will both have the same effect.
As "light" only has two states(1 or 0), you can use a Boolean variable instead(which can only have two states, "True" or "False", which actually represent 1 and 0, respectively).
I'll assume you're using an external command for the confirmation; VoiceAttack can handle that for you within a single command natively using the "Wait For Spoken Response" action(you can set a 10 second timeout as well, after which the value of the response variable will be "Not Set").
More info on that in
this topic.
This topic on control flow may also be of some use.
On the forum, you can click the
# button above your post to insert code tags, between which you can post your action list, so you don't have to change your text to prevent it from turning blue