Question regarding hook_user_presave() and setting roles
The documentation for hook_user_presave() says the hook is invoked when an user account is updated, or created, not just when the user account is updated.

If you look at user_save(), you will notice that $account-&gt;is_new is set before invoking hook_user_presave(), when the user account is being created. If the account is being updated, $account-&gt;is_new is not set, and $account-&gt;original contains the user object before any changes.

In Drupal 8, $user-&gt;is_new will be replaced with Entity::isNew().