One reason for using 'if (<condition>) { script }' instead of 'if (!<condition>) { halt }' is when there's a possibility of a valid response having a 0 (zero) value.

The !<condition> registers as true when <condition> is $false, $null or 0

I didn't look through the script to see if this might be the reason or not, but it's a possibility.

Additionally, if you had a lot of 'if (!<condition>) { halt }' statements, it's possible that not only that script, but other scripts could be unintentionally halted.