Identfying spikes in data
Your intuition about the algorithm is about right and is a known technique from six-sigma.

As you may expect from six-sigma, take 3 times deviation. You could also take the running average and deviation to compare the new value to if you expect trends.

You need to inspect the spike but can consider removing it, which will reduce variations again.