Some blog posts containing source code fail to save draft or publish

From a look at /wp-includes/default-filters.php:

Maybe one of the following filters is causing the problem. I’d try to remove_filter() them and see what happens:

add_filter( 'the_content', 'wptexturize'        );
add_filter( 'the_content', 'convert_smilies'    );
add_filter( 'the_content', 'convert_chars'      );
add_filter( 'the_content', 'wpautop'            );
add_filter( 'the_content', 'shortcode_unautop'  );
add_filter( 'the_content', 'prepend_attachment' );

If this doesn’t help, we’ll need another workaround.