Ok that adds a dangerous twist to things. While basic macros would be simple it would create an endless loop of A1 turning on A2 turning on A1... etc. I see now why you wanted to test the lighting state.
Let me give this some thought and see if I can think of a way to use flags and/or elses to keep from getting locked in an endless loop.
Are you sure can't just wait till your potential burglar walks around to the next light.
I have an idea as to how I'd do it but give me a bit of time to write it up. (I'm headed to a meeting now.) We may need to use a flag or two.
PM me again if I let it slip.
In the meantime, let me know if an A1 signal is sent from the A1 PR511 when it is triggered and what your time out is for your lights. Also is HC "A" your monitored code? Might be able to avoid using flags if it is. Do any other devices use the HC "A"? If not, I might have an easy solution.