Sorry for the delay in this, hopefully this will be of use to you or somebody else at this point.
The problem with the syntax in the above formula is the use of "=", which is the assignment function, as opposed to "==" which is for comparisons. So, if you use:
"YES" if (ALT_NAM1=="COUNTY" OR ALT_NAM2=="COUNTY") else "NO"
You won't get the syntax error.