OS X Mountain Lion comes with Text Expander as an option, but it only seems to work in Safari and not in iMessage and other applications.
Is there any way to enable Text Expander throughout the entire OS?
I'm assuming you're talking about the Language & Text > Use symbol and text substitution option found in the System Preferences.
Per comment on Tuaw: Set up Mountain Lion's text expansion options
It does work - at least in most native applications - but you need to turn it on in each application. Per Apple Support: Turn on text substitution features in an applications. Control-click and choose Substitutions > Show Substitutions. (In some applications, you can also choose Edit > Substitutions > Show Substitutions.) In the Substitutions window, select the text substitution features you want to turn on.