but the serial monitor still doesn't display any response when I push the button
Then the problem has nothing to do with the Arduino, since that second code will send data to the serial port every millisecond, regardless of whether you press the switch or not.
You should see stuff appear in the serial monitor, even if the baud rate is wrong. It won't make sense, but something will appear there.