It works exactly as described and expected. You should post a capx.
Sprite 0 moves downwards ever tick until it passes 786, then gets destroyed. Then myvariable increments every tick, and will run the last action every tick after it gets past 50. So what is in your last event in the [do something] part?