how to create a user programmatically using comment_presave hook?
There are some errors in the code you are using, but the main error, which is causing the error message you quoted is that the code is creating users always with the same username, which is not allowed in Drupal: Every user needs to have a unique username.

If you are showing exactly all the code you are using for that hook, it's not clear why you keep creating an account before a comment is saved. You aren't checking which user is creating the comment, which means the user account is created even if the comment is created from the admin user.

To avoid that error message, you need to first verify the account you are going to create doesn't already exist, or you create a different username every time a comment is created. (It doesn't make sense, though.)

In the first case, you use user_load_by_name() passing the username; if the function returns FALSE, it means a user with that username doesn't exist, and it can be created.
In the second case, you just add a random number to the username, to make it unique; even in this case, I would verify there isn't already an account with that username.

As for the other errors:


The roles array should be the following one:

'roles' =&gt; array(
  DRUPAL_AUTHENTICATED_RID =&gt; 'authenticated user',
),

The first argument of user_save() is an object, not an empty string, for example the value returned from new stdClass()