Ah, that does help!
But it doesn’t seem quite right. If the admin has assigned “additional capabilities” to a role, they appear to be listed early in the the array_keys. So maybe something like:
<?php
global $current_user, $wpdb;
$role = $wpdb->prefix . 'capabilities';
$current_user->role = array_keys($current_user->$role);
$ncaps = count($current_user->role);
$role = $current_user->role[$ncaps - 1];
?>
This assumes that the added capabilities would be added before the role. Not sure if that’s a safe/correct assumption.