How to loop a rule?

Thank you for the clarification.
My rule is triggered by different events and one is a window contact. So when the window is opened the rule triggers, but when the window is closed 5 seconds later the rule is triggered again and the second instance has to be run to set heating correctly. If the rules were queued, everything would be fine.
Is there a way to archive this ? - Exiting the first instance before running the second one ?