Rule Delay and Cancel Delayed Actions

I think the Wait for Condition will work better for you than looking at things every 5 minutes. The cool thing about a Wait is that every time the rule is triggered, the Wait is cancelled. Which means that it starts over. That's exactly what you are describing.

Something like this:

Trigger events: 
   deck motion becomes active
   deck door becomes open
Actions:
   Set Occupancy status true
   Wait for Condition: deck door is closed
   Set Occupancy status false

There is no timing involved. Assumes you that you only want occupancy to go false when the door closes after having been opened. I don't understand the point of the 20 minutes, so if that has some other purpose please explain...