If you are going to have this script wait here then you don't need any of the conditional stuff, I think this wait will work on all builds.
I moved to the element Wait to avoid the scenario where this script execution would pick up on unrelated script failures which we used to get a bit and would stop the whole test/run.
So I would prefer not to use this method.