oops. Never checked SMSsent. Is this better?
// Now see if the door is open if(!DoorIsClosed && !SMSSent)