How do I set Redactor formatting button to wrap selected text in two tags? ...
If it were me, I'd try to keep as much formatting cruft out of a wysiwyg as possible, it cleans things up down the road and keeps your content as structured as possible. If you ever change frameworks or anything else, that extra cruft can come back to haunt you because it's all stored in the database.

A better way is handle this with a couple Matrix blocks. Set one up for text, and then another one for code snippets. Then in your template when you want to spit out a code snippet, you just wrap it using whatever extra bits you need like:

{% for block in entry.myMatrixField %}

{% if block.type == "text" %}
    {# handle text #}
    {{ block.entryText }}

{% elseif block.type == "code" %}

    &lt;div class="code-snippet"&gt;
    &lt;pre&gt;&lt;code&gt;{{ block.codeBlock }}&lt;/code&gt;&lt;/pre&gt;
    &lt;/div.

{% endif %}

{% endfor %}


The upside here is that it's all built-in, you don't have to modify any redactor defaults to make this work. But the bigger upside is if let's say you're building a library of code snippets, it'd be super easy to query the Matrix fields and get just those snippets you want. 

You could even completely reformat the page and just show the code snippets, since you have them already broken out.

IMO that's what makes Craft so powerful, it's easy to use more structured data unlike other solutions *cough* like WordPress *cough* that put everything in one "field."