The var desiredstate doesn't update when the airlock closes automatically and so most of the time players have to hit the button twice. This keeps all functionality but with one button press.