In what way is it not reliable?

BTW you could replace:

FOR I=1 to 1000 'start a loop to die until DC power is disappears
Pause 1000
NEXT I


With:

End