Many people have been seeking this for javascript and css, so I have created a highlighter which will add colors. This is still a work in progress and is not efficient for long code, but it should work. Try it out: http://masterscriptmaker.co.cc/tools/hl.php
Highlighting is great for readability, and lets you know when you've done something wrong. For this reason, there should be an online highlighter that gives you the bb code too!