I would stick with the nested FOR loop. It works. I would not try to make your inter-TASK state behavior "work" (i.e. making sure on the LAST time through the loop on the LAST time the TASK executed, the STRPRINT power flow was OFF). Hacking the FOR loop index from within the loop is usually NOT a good thing.
Similarly, if you try to use C48 initially be OFF, then you run into the 65535 FOR loop problem due to the FOR loop index hacking from within the loop.
Hence, just use the nested FOR loop. It works, is straight forward, and there's no loop index manipulation going on.