Function: SetSpellDataIndex(spell, idx, value, value2)
Description: Prepares the values outside the spell mutex, then updates the selected Lua-data record as one operation and marks it for custom-spell persistence.
Parameters:
spell(Spell) - Lua spell object whose backing template owns the record.idx(int32) - Zero-based index. Negative or out-of-range indexes are rejected; indexes above 255 are not truncated.value(integer, number, boolean or string) - First value, using the record's existing type.value2(integer, number or string) - Second value for integer/float/string records; boolean records ignore it.
Returns: Boolean success for a valid record; false for an unsupported record type. Missing spell/data/index returns no values.
Record ownership: The backing template owns child values directly; readers receive copies and setters publish prepared edits. The instance must be admitted as described below; child-value ownership and VM execution are separate contracts. See Lua actor lifetime.