I've just realized that you can format code blocks on SFSE by adding the following prefix and suffix:
<!-- language: lang-or-tag-here --> insert code here <!-- end snippet -->
Refer to this page for a complete list of supported language hinting codes.
Refer to my answer here for an example.
This is pretty handy. Note that it's using using Google Code Prettify under the hood. Wondering whether it's worth submitting a pull request to add syntax formatting for AMPscript, Apex and Visualforce.