I'm not really sure. That was the one logic error I made when plugging in the options (wrong boolean option for an integer calculation). The other possibilities were accessing the options inside a tight loop. I doubt this could be it because it was looping over only a few units, and it was a huge slowdown.
The game hung for 20 seconds while loading, and clicking any stack (1-5 units) I could detect a 1-2 second pause. That seems too large for such a small loop, so I'm betting on the int / boolean. The odd thing is that the boolean was True, so it wasn't even a divide by zero exception. I'm just glad it's fixed, as I really didn't want to back out all that work!