OK, do a search for Timer interrupt first. in the interrupt routine you'll have to determine:
1. i'm i on the HIGH pulse?... since how may time? enough? if so do the low pulse
2. same as 1 for low pulse

try it. If there's any other problem, i see some method.

OR do a short pause loop, check the pin state in the loop.