This didn’t work for me in CC. Turns out AE doesn’t like such a small value for the scale check condition. Changed it to the following and I no longer get expression errors.
if ((Math.abs(scale[0]) > 0.01)&&( toCompVec([0, 0, 1])[2] > 0 )) value else 0