State variables and millis help.

I disagree with @PaulS about global variables - I like them.

I also think that "if (alarmSounding == true)" is likely to be more obvious to a newbie than "if (alarmSounding)" which does exactly the same thing.

I have a lot of sympathy for Paul's comment about the button "becoming" pressed, but I think there is more to it than that.

The question of what to do if the user continues to press the button needs a little thought. My first assumption is that the user will never keep his finger on the button for any appreciable length of time compared with the buzzer duration. It would be simple to ignore button presses until the buzzer completes its buzz, but if the user still has his finger on the button the buzzer will immediately start again with no apparent interval. If you introduce a deliberate interval between buzzes it will make the button appear unresponsive.

Over to you ...

...R