How to disable a link/wire temperately base on switch state?

My situation:
I have an automation to turn on the nightstand lights when I open my bedroom door. But when I manually just turned them off from the inside, and open the door to leave, the automation will turn them on again. So if the light is on and I want to leave the room, I have to open the door first, and then turn off the light before I close the door. And if the light is off, the light will be turned on even if I don’t want to when I open the door to leave the room.

My mitigation:
I added a light sensor in my bedroom so the automation will not run when it’s bright enough.
I also added a time range node so when I leave around 6 AM for work and it’s still dark I won’t set the automation on and turn on the light with my partner still in sleep.

My problem:
I still can’t find a way to temporarily disable this automation for a short period of time (1m?) based on light state, so when I turn off the light before I open the door to leave the room the automation will not run and set the light on.

Here is my current setup:

Can you simply add the check states after the door state change, you’ve kinda written the pseudocode in your problem statement?
It seems your door automation should just turn ON the light?
You should TOGGLE the light?

I am not sure what you mean. My problem is if I open the door after I turn off the light from inside of the room, this automation will trigger again and turn on the light as I am leaving the room.

Sorry see my reply below.