On door open - Logic problem

Yes, but the toggle code should still be there. I think the logic is this, but I don't know how to do it:

The actual code is some kind of "normalMode", when the toggle LED code works.
Setup -> bool normalMode = true;

And when the door is open for more then, let's say 10 seconds,
the LEDs should turn green, like the room is free, in case you leave the sliding door open,
for ex. if distance < 30 && more then 10 seconds elapsed, normalMode = false.
if Normal mode = false {
analogWrite(green_LED, 225);

and then when you close the door (distance > 30), it should get back to the "normalMode" starting with LEDs being RED (room is busy).