Using Switch in a If if condition

lastButtonState = buttonPushCounter;
was his old code. It did not make sense to me, as the pushCounter has nothing to do with the button state. So my idea was to change it to
lastButtonState = buttonState;

Did not had the time to write a longer answer, so I just took his code and added my ideas, without removing the old parts.