Your script looks good, except for one fatal error. In your initialization loop, you try to assign the array elements starting with element 30, then downwards to element 1, which is illegal.
Here's the description of Arrays from the OBSE documentation:
An Array behaves like arrays in most programming languages: the key is an unsigned integer starting at zero, and there are no gaps between elements. (In other words, if an element exists at indexes 1 and 3 then an element necessarily exists at 0 and 2). Attempting to access an element using a key which is greater than the highest key in the array results in an error. The only exception to this rule is during assignment: it is okay to assign a value to the key which is one greater than the highest key in the array.
What this translates to, is that after construction of the array, the only element you are allowed to assign a value to, is element 0 - and when you have done that, so that element 0 exists, you can assign to element 1, etc. Trying to assign a value to element 30, means that you try to make a gap in the array (no elements 0-29 yet). So change your initialization loop to something like:
set counter to 0 set timeRate to 0 set currentScale to myQuest.myQuestVar while (counter < 30) let tScale[counter] := timeRate set counter to counter + 1 set timeRate to timeRate +0.4 loop
Note that this will make the array go from elements 0-29 and not 1-30, so your check must reflect that as well.
If you need gaps in the array, make it of type Map instead of type Array, but that is a much less effective array type, and not needed here.