We have added support for doing autocompletion of the subject on the Trac admin permissions page.
Autocompleting the "Add Subject to Group" is relatively straightforward.
Autocompleting the "Grant Permission" is a little bit trickier because you may also be granting permissions to groups. For that, we added general support to optionally specify that the returned list should include groups and pass that along in the request for subjects when granting permissions.
The PermissionSystem component does not have direct support for just getting the list of groups, so SQL is done against the permission table to dig out the list, which is then also filtered by the search criteria. Any matching groups are then added to the end of the user list (as opposed to sorting them into the user list itself).