How would you script a gear shift stick?

Hi everybody!

Let me elaborate.
I need to script some sort of switch similar to an automatic gear shift stick. In other words, I want to press a button that increases a float with 4 button presses, or 4 speeds If you will, and another button to slow down, again with 4 button presses to reach 0. 4 is just an arbitrary number BTW.

Any ideas or perspectives are greatly appreciated!!