Bottom line is that "variables" in OpenSCAD aren't (variable, that is). You cannot change the value of a variable once it is assigned. Attempting to do so can apparently have a variety of results, none of which are what I expected.
From <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/General#Variables_cannot_be_changed%5C>:
The simplest description of OpenSCAD variables is that an assignment creates a new variable in the current scope, and that it's not legal to set a variable that has already been set in the current scope. In a lot of ways, it's best to think of them as named constants, calculated on entry to the scope.