Score counter for pinball machine

Okey. I think I've got hold of the target.
Note the use of debug printings in my suggested code. That's a very useful tool for debugging, getting facts and not use wild guessings for what to try next.