case 97: // Received ASCII a
or
case 'a': // No comment needed
Serial.flush();
Block until all pending serial data has been sent. Why the hell do you need to do that?
if(Serial.available() == 1)
Suppose two characters arrive while the alarm is doing it's thing. From the on, the Arduino can do nothing. Using >= makes much more sense.
port.WriteLine(Console.ReadLine());
Send a letter and a carriage return and a line feed. While the letter is being dealt with, two more characters arrive. Well, that explains why the Arduino "hangs".
for (int i = 0; i < (10000 * port.BytesToRead) / port.BaudRate; i++)
; //Delay a bit for the serial to catch up
This is as stupid on the PC as it is on the Arduino. DO NOT DELAY WAITING FOR SERIAL DATA TO "CATCH UP". Serial data is SUPPOSED to be asynchronous.