How to break up user roles checkboxes into groups? When editing a user in Drupal 7 (/user/NID/edit), I'd like to break up the roles checkbox options. By default, it is just one list of roles. Instead, I would like to group different roles together to make it easier to read for the admins.

Ideally, there would be a group name header, followed by a certain subset of roles and then another head followed by another subset of roles, etc.

There is no change to the functionality of the roles.  This is purely a theming exercise.
One way to do this would be to use some JS to add a header element in front of the role that starts the group.  Each role has a unique id, e.g. input#edit-roles-2.  You could use some jQuery like:

$("input#edit-roles-2").before("&lt;h3&gt;My Group&lt;/h3&gt;");


You would have to order the roles the way you want and find the right ids.

Also, this will probably require using a custom admin theme or a module in order to inject the JS since user editing generally uses that theme and not the main theme.