On action, change user role

wonder if you can help me.

I’m trying to get an action (geodir_after_save_listing) to change a user role.

Basically, in Geo Directory, when the user submits a business listing, I want to change their role from “member” to “member_with_business”

I believe the geo_dir_after_save_listing is still a relevant action (awaiting response from GeoDirectory support) so IMO the php snippet below should work?

add_action('geodir_after_save_listing', 'change_user_role_when_submit_business');

function change_user_role_when_submit_business( $last_post_id, $request_info ) {
  $gd_post_type = geodir_get_current_posttype();

    if ($gd_post_type == 'gd_place') {

    $user = wp_get_current_user();
    $roles = $user->roles;
    
    if (in_array('member', $roles)){
      
        $user->add_role( 'member_with_business' );
        $user->remove_role( 'member' );
    }
  }
}

Any thoughts from those more php savvy than me?