Hi andywpg. I don't know what you're adding this feature to but perhaps a simpler approach will work:

start:
if switchport = 0 then blinkled 'switch open (or closed depending on pull ups or pull downs)
if switchport = 1 then high ledport 'switch closed
goto start

blinkled:
high ledport
pause 250
low ledport
pause 1000
if switchport = 1 then start
goto blinkled