Kessral

If I understand you correctly, you want to do a pulsout (1) every time the PIC is woken by the magnetic switch. Waking on a magnetic switch can be done by a pin change interrupt, if available in the 10F(Havent used, so I cant comment on this). So, your ideal work loop will be something like

while (1)
PULSOUT pin, period
@ SLEEP
@ nop
@ nop
' on waking from interrupt, go back to pulsout
wend

Of course, I haven't shown the part needed to configure the PIC for interrupt on change, etc

Jerson