How about just using a flip-flop? Press to open, walk through, then press to close. The bank uses one. You never have to worry about people getting trapped or squished.
It's generally good to keep doors that keep mobs outside on an auto-close timer for two reasons. One is that players are sometimes followed by mobs and don't have the ability to defend themselves and second is that doors players sometimes forget to close doors...
In the image I showed, you can close the door behind you by leading the inverted signal from another button into the and gate instead of the repeaters. However, you'll need to ensure that the outside button works in reverse when the player enters from the outside.
Last edited: