How do i stop the buzzing action once door sensor is opened (LOW)

Have you forgotten to read the door switch input and change the value of the state variable in your program ?

HINT : the buzzer only sounds when its value is LOW

It is not a problem but it is easier to understand if you do not to mix the use of 0/1 and LOW/HIGH in the program.