script editor incorrectly changing parentheses

script editor incorrectly changing parentheses

I have a validation script which is being saved without any syntax error but when the same script is subsequently reopened for editing,  not changed, and then saved again, the editor throws an error due to the automatic changing of parentheses.

The following line saves correctly:

if (count(Client_Contacts[((Client == input.Client) && (Is_Billing == true) && (ID != input.ID))])  =  0)

However, the script editor changes it to this:

if (count(Client_Contacts[((Client == input.Client && Is_Billing) && ID != input.ID)])  =  0)

Which causes the following error when I reopen and save the script without making any further changes:

Error in statement at line number 23
Either the left or the right expression in a boolean expression in the criteria has to be a Form/Table Variable


I wish the script editor would stop messing with the user's script syntax altogether, including parentheses, spacing and line breaks. It is very frustrating.