DigitalWrite in loop without repeat

i try to make it simple,

whenever D10 is high it should on the led (D11) for 5 secs and then stop.
whenever D10 is LOW led should again on for 5 secs and then stop.

with this codes (blinkwithoutdelay included) led keep on blinking (repeating code) after every 5 secs even if 12 is high constantly,

what i need is it should do only once.

hope i explained my issue well this time.