How to create a locked door detector?
There are two kinds of push buttons. There are some with a lock mechanic (which will remain on the last state until it's pressed again) and there are some without this lock (which will remain open/closed while the button is pressed).

The problem I can see with the push buttons as sensors in this case is because they have limits of activation. Sometime they will wear and lose sensibility or even they will not switch anymore. Datasheets specifies it, usually is about hundreds of thousands or millions times.

I think the space is enough, but it will relies on your skills designing the PCB.