How to automatically replace a double exclamation point when a message is saved?

IMHO the best way would be to write a plugin that would automatically replace [\s!]+$ by a single !.