you could use a global variable to save the status of the door. Or you could assign this variable directly to the door during construction.
puerta.abre = False (assuming abre is open

)
then in the mouse even function check if the door is open or not and execute the appropriate function to open or close it.