I just isolated the line of code that caused an intermittent Floating-point invalid operation error to be this:
Text_Plot_Top = round(GetAppInfo(aiHighestDispValue), 1);
The error would stop the indicator but I'd be able to restart it and it would keep working. Couldn't replicate in playback, but got the error while importing and compiling indicators on my laptop after hours while the market was stopped. I removed the round() function and the problem was resolved.
Maybe everyone else knows not to round the return values of these functions, but I didn't and this problem has been a minor irritation for quite a while. Don't do what I did.