Even when OPTION STRICT is not specified, using the function version of VAR gives an undefined variable error. It seems like your best bet would be a lookup table, since you would also be avoiding messing with variables that your program uses.
DIM VARLOOKUP$[0] DIM VARMETA[0] `0 INT, -1 FLOAT, -2 STRING, >0 IF OBJECT WITH VARS; DIM VAL%[0] DIM VAL#[0] DIM VAL$[0]With this method, when you encounter a new variable name, you simply push the name of it to the table and to the array of its type. The second dimension of the VARMETA array can be used to save information such as whether it is a normal variable or. If the variable is an object with variables of its own, you can simply use positive values to specify how many need to be searched for the referenced name. If the variable loses scope in the program you can use some index shuffling to pop the variable/object.