How to add user role as a class while rendering a username
You need to preprocess the theme function, and add to the attributes array or link options, depending on context. Currently you're overriding the theme function and reducing its output to an empty string.

function MYTHEME_preprocess_username(&amp;$vars) {
  foreach($vars['account']-&gt;roles as $role) {
    if (isset($variables['link_path'])) {
      $vars['link_options']['attributes']['class'][] = 'role-' . drupal_html_class($role);
    }
    else {
      $vars['attributes_array']['class'][] = 'role-' . drupal_html_class($role);
    }
  }
}