Create a new user from an entry submitted with the module "webform" i'm using the module webform  so that user can ask for the credentials to login to the site. I need to add a button to the the "view" of each submission so that the user that it's viewing that submission can create a user. 

Do i have to modify the code of the module to achive this or should i write my own module? If i write my own module what hooks should i implement to add the button, the logic for the button to be present only if i didn't create a user, and the custom action for that button?
I am also looking for a similar solution and would like to reuse an existing one.
To assign a role on registration I would try some of existing modules.
Let me summarize what is available:

Auto Assign Role (D7, D6, D5)
Registration_Role (D5, D6)

To allow a user to choose a role on registration

User-Selectable Roles (D5, D6)

To provide a role using a key during registration

Registration Codes (D7, D6)

Sold Memberships

Ubercart (D7, D6)

Join role with a password

Join role with password (D7, D6, D5)

Apply for role

Apply for role (D7, D6)

Webform register

Webform register (see Open Issues for details)

See also integration Webform and registration module.