Write one tag twice (Fail)

I’d like to write one tag twice, but the function isn’t works. When gateway tag change script be triggered, the tag value will change to 1, but can’t back to 0. Is there something wrong?

Version: 8.1.13
The script is as below:

system.tag.write("Temp/ReplyBit", 1)
time.sleep(1) # Delay for 1 second
system.tag.write("Temp/ReplyBit", 0)

It is dangerous to use sleep. (Any kind of sleep or CPU burning wait-loop.)
Use a timer event and a state machine, where state is kept in a separate tag. Consider using a datetime tag to hold a “turn off” deadline that the timer event can examine and act upon.

Let me repeat: Don’t use any kind of sleep().