A couple of very good resources for formatting your code for inclusion into blogs
Simple and very effective
http://www.dan.co.jp/cases/javascript/encode_entities.html
Two more with some added features:
http://formatmysourcecode.blogspot.com/
http://codeformatter.blogspot.com/2009/06/about-code-formatter.html