What I would do is create a list of type string for the role names. During the user creation/update, loop through the list of role names, look the role name up by name or code name, if it exists, assign the user you're creating/updating to that role.
foreach (User u in userList)
{
List<string> userRoles = new List<string> { u.Role1, u.Role2, u.Role3 };
foreach (string r in userRoles
{
var role = RoleInfoProvider.GetRoles().WhereEquals("LOWER(RoleDescription)", r.ToLower()).FirstOrDefault();
if (role != null)
{
UserInfoProvider.AddUserToRole(u.UserID, role.ID);
}
}
}
Just typed this off the cuff so you'll have to correct any mistakes or API calls but this should get you in the right direction.