unity – Iterate over a loop to calculate a sum, or update a sum variable as items are added and deleted from a list?

First rule of optimization: profile first!

Computing a sum each frame instead of updating it could be seen as a waste of CPU time, but it might be negligeable compared to all computation done each frame, so optimizing it would result in no visible result. Plus, determining if it is to be updated can require the same amount of CPU time.

If that’s the case, adopt the method that you’re more comfortable with, is easier to write (without bugs, of course), to read (readability is very important, I’d take readability over premature optimization every day) and to maintain.
If your case, you’re mentionning niche cases. That alone is a big threat for write code without bugs and for maintainability.

In conclusion, I would iterate and compute the sum from zero in each frame. Only if I found that it is a potential performance bottleneck, I’d try to find a less CPU-consuming method.
Once again: profile first!. This reasoning must be performed again in each case, and not applied everytime without thinking about it.