In ChoiceScript, array notation is just syntax sugar. Behind the curtain, CS creates as many simple variables and just appends a suffix. You can access them by name (in this case sample_spell_1) or by array notation (sample_spell[1]). There are no real arrays in ChoiceScript.
When you use a variable by reference, it’s going to resolve the reference part of the command first. That’s why *set {spell_name}[1] true is not going to work.