1) Be sure to use the autoformat feature or format the code yourself within your code editor so that everything is nice and neat. Code tags don't help much if the code isn't already reasonably formatted in the first place.
2) copy and paste the code into the text box.
3) Highlight the entire block of code that you just pasted into the text box.
4) Press the # button to the right of the text box. It will automatically surround the highlighted text with the code tags.