I find a simpler pattern is;
var Timer doorTimer = null
rule "Notify on door open"
when
Item Door_Contact changed
then
if (doorTimer != null)
doorTimer.cancel()
if (Door_Contact.state == OPEN) {
doorTimer = createTimer(now.plusMinutes(5)) [|
// do notification
]
}
end
This works well since you only need a single rule. When the door is opened, the timer is created. If the door is closed before the timeout then the timer is cancelled. Otherwise the timer fires and you get notified.
Simple but effective.