if( Door_Is_Open )
{
   // Do stuff for open door
}
else
{
   // Do stuff for closed door
}