if (isnull($in.0.ID)) $in.0.ACCOUNT_NAME; else $in.0.BILLING_CITY;
should work. I added round brackets around condition and add semicolons for each statement. Also, you are probably missing left side of statements. So it should be something like:
if (isnull($in.0.ID)) $out.0.MY_FIELD = $in.0.ACCOUNT_NAME; else $out.0.MY_FIELD = $in.0.BILLING_CITY;