Add Legend to Text Format Fieldset
I got this to work like this:

function mymodule_process(&amp;$variables, $hook) {
  if($hook == 'comment_wrapper') {
    $variables['content']['comment_form']['comment_body'][LANGUAGE_NONE][0]['format']['#post_render'][] = '_mymodule_post_render_fieldset';
  }
}


function _mymodule_post_render_fieldset($content, $element) {
  $your_legend = '$0&lt;legend&gt;Your comment legend&lt;/legend&gt;'; // $0 is the full matched string
  return preg_replace('/&lt;fieldset[^&gt;]*&gt;/', $your_legend, $content);
}


Care to give this a try?