thejfk,
As indicated by the thread that
AlanV provided, delays can be very helpful when using Bright/Dim commands. These are actually a series of concatenated commands that can last for several seconds (3.67 seconds for a Bright 100% command). This is both hard on repeaters (if you have one) and receivers. A delay helps allow the devices recover from this onslaught and prepare for the next valid command.
Unfortunately, that's not the problem you are encountering since you're using a Socketrocket (simple on/off commands).
In this instance, I'd submit that the failure of your macro was due to an "improvement in atmospheric conditions". Basically I believe your motion sensor began communicating "better" with the CM15a and you started to receive multiple RF on requests.
I've experienced problems with this when using an RF repeater in remote areas of the house. I would at times see as many as 5 RF on requests for a MS12a and macro's would execute, but not transmit PLC signals. Adding flags to prevent re-triggering did not help. The one second delay solved the problem.
What I attribute this to (purely conjecture on my part) is a documented problem with the PIC itself. It seems that the processor has a problem with generating interrupts from the GPIO port. As a result, the CM15a must "Poll" the port for information. From what I have seen, the CM15a is unable to reliable transmit PLC data while trying to field RF commands (the RF may take precedence). The 1 second delay may allow time for the RF to expire thereby allowing the CM15a to reliably transmit over the power line.
Far from a "scientific explanation", this is pure conjecture. Nonetheless, all of my RF triggered macros have at least a 1 second delay at the start (regardless of whether I use flags).
The following macro gave me fits after I had to add an RF repeater on the 2nd floor of my home. After adding the repeater, I would register multiple RF on commands and the A10 on command would not be transmitted. Prior to addition of the repeater, operation was 99%. The addition of the 1 second delay fixed this macro (even though the macro was flag qualified).