And yet, here's the weird thing. I have a global variable that's 22 characters long, and the scripts that set it have been running fine. The one that was causing the problem was only 18 characters long. The variable was set fine in dialogue without causing any problems, and yet the script consistently caused a CTD when it tried to set the variable to a new number. There's no consistency here!
zhariphel_construction <- works fine, no problems
uvi_zhar_questmove <- works fine when set in dialogue, CTDs when set in script