"Pause Until" gives unpredictable results

And are those windows in a Space (as per your other post)?

Spaces are, in general, a PITA when it comes to scripting and automation -- Apple simply hasn't made query/control Public APIs available. Searching the Forum for threads about Spaces may give you some ideas but, in the meantime, try running a macro that only reports the names of Terminal and Audacity windows -- it may be that the Editor's (presumably in the same space as the windows) evaluation differs from the macro's for some reason.