I tested it on the actual game.
Actually it might work...
I tried dropping roses, and if I can read your code correctly..
Checks if less than 1000, or greater than 5000

so it might have caused a false positive

Oh wait nevermind >.< sorry im tired XD