Follow it through in your head. When G is pressed, and NumberTest is 0, it will be set to 1. On the very next line it says, if NumberTest is 1 (which it is because you just set it) then set it to 0. So almost immediately you've set it to 1, then back to 0 again. You probably want to have 2 'On G pressed' events, one for each of those lines.
A nicer way would be to do
On G pressed
Sprite | Set NumberTest to 1 - Sprite.NumberTest
edit: otherwise else as suggested above. Lots of choices