This [SQL] bbcode breaks when previewing or quick editing in full WYSIWYG mode.
To fix this, you can add an HTML comment to the beginning and end of the [sql] bbcode replacement text (to identify where it begins and ends), and then in a plugin on wysiwyg_parse_start (or wysiwyg_parse_complete (either one should work)), add something similar to this:
PHP Code:
$text = preg_replace('#<!-- {STARTSQLTAG} -->(.+)<!-- {ENDSQLTAG} -->#U', '[SQL]$1[/SQL]', $text);