Why do some scripts keep running when I press the green flag again?

Usually, pressing the green flag should essentially be the same as pressing the stop sign and then pressing the flag - it just restarts the project. But I’ve noticed that some of my scripts keep running after I press the green flag again, which throws the project out of balance.

It’s no problem for me to press the stop sign first and then press the flag, but why is this happening in the first place?

the green flag button does not work the same as scratch. scratch stops all of the scripts first and then starts any scripts with the green flag hat block. snap does not stop any currently running scripts when pressing the green flag button, but still starts any scripts with the green flag hat block.