Help with code for a Halloween prop

using a photon on a v2 (newer) relay board.

what happens...
upon photon startup without any motion sensor input, relays D3 & D4 come on and toggle like they are supposed to. But that action is supposed to be triggered by motion. The toggling action occurs for the specified amount of time (10 secs), then immediately start toggling again. This goes on until I unplug the photon.

Expected behavior...
Once the photon is powered up, it should await motion sensor input, wait for a 1/4 second then toggle the relays on and off for 10 seconds. After that, it should return to a state awaiting motion sensor input again.

I had another post going,

but didn't hear much from anyone after that, so I thought I would charge ahead with your code from last year (modified), with some success.