Again, haven't checked, but I'd imagine:
Hope that helps.
$mybb->user['usergroup'] = 5; // send cached user to the new group
// update $mybb->usergroup
global $groupscache, $cache;
if(!is_array($groupscache)) $groupscache = $cache->read('usergroups');
$mybb->usergroup = &$groupscache[$mybb->user['usergroup']];
Hope that helps.