Precisely, it's a legacy system, and I don't want it waking up on its own once I've given it a sleep command.
It's currently using sleep and wake scripts that disable time machine on sleep, and re-enable it 10 minutes after wake (TM has this stupid habit of attempting to run the instant the machine wakes), so I want to add another one that I can rely on to issue a sleep command (triggering the sleep script which will turn off TM) & put the system to sleep after it finishes its current (sometimes hour+ long) TM run.
Can that be done the other way around - executing the shell script to test for the answer, THEN running the pause step? My impression is that if I were to use it as per the screenshot in my existing On Sleep trigger, triggering sleep would always incur that pause, even if TM wasn't running.
I think I'd prefer to keep them as separate functions to be honest - my existing On Sleep which just disables TM, and a second "Sleep After" function which I would only use when I need to sleep the machine while TM is in progress, but don't NEED the machine to go to sleep at that moment. So if the outcome of the Sleep After function then triggers sleep, that should then trigger my (separate) On Sleep function, correct?
Do it in whatever way makes sense to you. You could use the above as a separate macro which you run from your "main" with an "Execute Macro" step -- when "Asynchronously" is turned off (the default) your "main" would be blocked until TM had finished.
But it does seem to be all of a thing:
Pause until TM completes, if running
...so I'm not sure what you gain by separating it out. Even if you wanted the nuclear option of "sleep without waiting" to be available I'd suggest the same macro but with a second trigger -- eg ⌃⌘S and ⌃⌥⌘S -- and if %TriggerValue% contains ⌥ you don't run the "Pause while..." loop.