Interrupts and Global Variable Access

ISR (TIMER1_COMPA_vect) {
 if (counter > 0) { counter--;  Serial.print("=== compare interrupt: "); Serial.println(counter); }  
}

You should not be using Serial.print from within an ISR. Set a flag in the isr, and print in loop based on the state of that flag.

What version of the IDE are you using? Somethings have change lately with the serial buffer. Your code does not hang for me with 1.6.9 and I get

setup started...
setup done
*** press 1 or 2 or 3 or 4
*** key pressed: 1
fff setting counter to 5
=== compare interrupt: 4
=== compare interrupt: 3
=== compare interrupt: 2
=== compare interrupt: 1
=== compare interrupt: 0
fff counter is now 0
*** press 1 or 2 or 3 or 4
*** key pressed: 2
fff setting counter to 5
=== compare interrupt: 4
=== compare interrupt: 3
=== compare interrupt: 2
=== compare interrupt: 1
=== compare interrupt: 0
fff counter is now 0
*** press 1 or 2 or 3 or 4
*** key pressed: 3
fff setting counter to 5
=== compare interrupt: 4
=== compare interrupt: 3
=== compare interrupt: 2
=== compare interrupt: 1
=== compare interrupt: 0
fff counter is now 0
*** press 1 or 2 or 3 or 4
*** key pressed: 4
fff setting counter to 5
=== compare interrupt: 4
=== compare interrupt: 3
=== compare interrupt: 2
=== compare interrupt: 1
=== compare interrupt: 0
fff counter is now 0
*** press 1 or 2 or 3 or 4