As I explained, and as Srpgfld did; WHILE usually indicates that there will be a loop. To stop a WHILE function, usually we put UNTIL. And when there is a loop, at the beginning of the loop we usually put conditions; such as IF NOT Player.Dead - the script will loop as long as the player is alive. And then you can deactivate the loop by putting condition duch as IF 0@ == 1 - so loop will happen as long as the command is active, when you type the command again it will go 0@ == 0 - the condition above is not fulfilled so loop want happen until you retype the command (0@ == 1 again) - and you can combine it with other conditions such as Player.Dead:
IF AND
0@ == 1
NOT Player.Dead($PLAYER_ACTOR)
THEN
bla bla
REPEAT
OR
IF
0@ == 1
THEN
IF
NOT Player.Dead($PLAYER_ACTOR)
THEN
bla blsabka
END
REPEAT
I'm writing this on my phone and haven't scripted in a month really; if there are any errors, PLEASE, Springfield, Opcode, TH3RM4L - correct me.
Enjoy scripting, lad!