Playing sound when float reaches zero (Door close/open)?

Isn’t that simply because you have two instances of the door, one closed and one open, and they just have to take turns printing out their respective messages?