How to modify attributes of fieldset-wrapper?
Looking at theme_fieldset the fieldset-wrapper class is hardcoded and that div doesn't take any additional classes from the $variables array.

So looks like the only option is to override theme_fieldset in your template.php of the active theme. If your conditional variables are present in $variables then you could do the logic straight in the theme_fieldset override function (replace mythemename with the name of your theme)

function mythemename_fieldset($variables) {
  $element = $variables['element'];
  element_set_attributes($element, array('id'));
  _form_set_class($element, array('form-wrapper'));

  $output = '&lt;fieldset' . drupal_attributes($element['#attributes']) . '&gt;';
  if (!empty($element['#title'])) {
    // Always wrap fieldset legends in a SPAN for CSS positioning.
    $output .= '&lt;legend&gt;&lt;span class="fieldset-legend"&gt;' . $element['#title'] . '&lt;/span&gt;&lt;/legend&gt;';
  }


  // Condition/logic here
  $class = '';
  if($variables['....'] == '....') {
    $class = ' well-small';
  }


  $output .= '&lt;div class="fieldset-wrapper'.$class.'"&gt;';
  if (!empty($element['#description'])) {
    $output .= '&lt;div class="fieldset-description"&gt;' . $element['#description'] . '&lt;/div&gt;';
  }
  $output .= $element['#children'];
  if (isset($element['#value'])) {
    $output .= $element['#value'];
  }
  $output .= '&lt;/div&gt;';
  $output .= "&lt;/fieldset&gt;\n";
  return $output;
}


Otherwise, a more elegant solution (by @Mołot) would be to supply use drupal_attributes like so:

mythemename_fieldset(&amp;$variables) {
  $element = $variables['element'];
  element_set_attributes($element, array('id'));
  _form_set_class($element, array('form-wrapper'));

  $output = '&lt;fieldset' . drupal_attributes($element['#attributes']) . '&gt;';
  if (!empty($element['#title'])) {
    // Always wrap fieldset legends in a SPAN for CSS positioning.
    $output .= '&lt;legend&gt;&lt;span class="fieldset-legend"&gt;' . $element['#title'] . '&lt;/span&gt;&lt;/legend&gt;';
  }

  $element['#wrapper-attributes']['class'][] = 'fieldset-wrapper';

  $output .= '&lt;div' . drupal_attributes($element['#wrapper-attributes']) . '"&gt;';
  if (!empty($element['#description'])) {
    $output .= '&lt;div class="fieldset-description"&gt;' . $element['#description'] . '&lt;/div&gt;';
  }
  $output .= $element['#children'];
  if (isset($element['#value'])) {
    $output .= $element['#value'];
  }
  $output .= '&lt;/div&gt;';
  $output .= "&lt;/fieldset&gt;\n";
  return $output;
}