Functions? Creating a Radio Hub

Before this project I used 2 LEDs to indicate whether the door is open or closed. One would only respond to message 111 and the other would only respond to message 112. I reused the same code for this project. Maybe I need to separate them like that and have a boolean DoorIsClosed and DoorIsOpen. I'll try to make my names more understandable!