Is it possible to have an optional bool flag for getVariable to set the variable automatically if it doesn't exist?
_obj getVariable ["var", default, setIfDoesntExist]
It would be very useful when working with array references, since you don't have to use setVariable anymore:
_arr = _obj getVariable ["my_array", [0, 0], true]; _arr set [1, _newValue];