As with most things in umbraco, there are a couple ways to do this. Here's one way...
Create a macro that has a multiline text box parameter (let's assume the parameter's alias is 'code'). Check the "use in editor" box. This is where you'll paste your html code.
In the xslt associated with that macro, I'd have something like the following:
Code:<div class="code">
<xsl:value-of select="/macro/code" disable-output-escaping="yes"/>
</div>
Then you can style your div with css to put a box around it, assign a fixed-width font such as Consolas or Courier, and your output should be solved.
When you're in the rich text editor, simply click the "insert macro" button and select the macro you just made whenever you want to put some code in. Paste in your raw html. That's it.
You'll want to add line break handline (check out the umbraco.library:Replace() function) but that's the basic idea.
cheers,
doug.
MVP 2007-2009 - Official Umbraco Trainer for North America -
Percipient Studios