It's not a big deal in this situation, but as a general good practice don't let any event run every tick if it doesn't need to (event 5).
Basically your objects don't need to change unless sprite.cows changes, and sprite cows will only change on user input.
So in this case I'd probably make it a function that gets called as an action in events 9 and 10.
Normally though, I would put the whole thing as a subevent of a trigger if I could, similar to what I did in my example.