Hello,
let me add context to why you are getting this object not found error at least in this particular case. Simplifying the script you have to the following
there is a condition that when met, you define a variable inside the if block and set it to a value.
Later outside the scope of the if block you do another if and use that variable. This is variable scoping, the variable isLeft will only be defined if the first condition is met
Now if the first condition was not met, the variable isLeft will never be defined and the second if will fail with isLeft object is error. This is because Arcade has inherited its behavior from Javascript.
Why did this work in 3.0 and not in 3.1? Well I could argue that the script may also fail in 3.0 or any release as well if $feature happened to not satisfy the first condition which leads to the variables to not getting defined. I think you can reproduce this in 3.0 by creating a feature outside Test_Jurisdictions.
So the real solution for more predictable script is to define the scripts outside the scope. that is move isLeft and IsRight so they are at global scope if you are planning to use them across the script.
If there are any other cases where the script fail but the syntax looks correct please post it in the this thread and we will take a look.
Hope that clarifies it. Thank you and apologies for the late reply.