Using Switch in a If if condition

You need to update LastButtonState somewhere,

Then, read up on functions, and for() loops.
Your code could shrink by 80% or more.