Hi Stefan!
The normal alerting functionality would, in my opinion, not be able to cover the functionality that you are looking for. But you might be able to do something using a combination of alerts and javascript calculators.
I might be rambling as well, and it might get hairy, but hear me out:
With a javascript calculator you can read the value of your metric, and generate a new ones. Let's call your original metric "StefansMetric" and your new metrics "AlertGroup1", "AlertGroup2", etc..
You can keep the previous values of your metric in an array to check if it has been in a specific state over x periods. Also, you would need to define the thresholds of "StefansMetric" and keep some information within the javascript calculator.
Now, as long as "StefansMetric" is below the warning threshold, you're fine, and you would set "AlertGroupX" metrics to 0. As soon as "StefansMetric" exceeds the a given threshold, you add a warning entry in your array. If in the next interval "StefansMetric" is down to normal again, you remove the warning entry from the array. The "AlertGroupX" metrics are still 0 in these two intervals.
If by any means, it still exceeds the warning level, you set "AlertGroup1" to 1. You define a normal alert on the metric, and send an email to the first group for exceeding the "caution" level. The idea is to keep track of what alerting level you're at in the javascript calculator.
If "StefansMetric" stays above the critical threshold, you add new entries to the array. And you always count how many entries you have. If "StefansMetric" stays in a critical state for 4 intervals, you set "AlertGroup2" to 1, and send an email to this group using a normal alert. And so it goes on and on
As soon as you're back to normal, for more than two intervals, you check which of your "AlertGroupX" metrics have the value 1, and set all of them to 2. The alert would claim that this exceeds the "danger" level, but in fact you send an email saying everyone can sleep well again In the next interval you set all of the "AlertGroupX" metrics back to 0 again...
I warned you, this might get a little hairy... muaaaah. And I haven't really tried it out myself yet. But if you feel like doing some javascripting, it might be funny to give it a try.
Call me if you have any questions.
Cheers,
Stig