In fact, have a look at all the cool snippet functionality in TextMate:
http://macromates.com/textmate/manual/snippets#snippets
There's a reason it's become so wildly popular on the Mac

Also, have a look at this tutorial for the SuperAbbrevs pluging for jEdit, as it gives a good insight into this hugely powerful feature. It's like all the best bits from snippets with replacement tokens and Auto Replace all in one.
Charles