As others have said, it would need some kind of failsafe to prevent it from swapping maf with town, as any role that can convert maf to town is far too powerful. It also shouldn't be able to swap itself. Having said that however, if those options were removed it could be interesting to play.
You have to make it that if you try to switch a mafia player with a town player, it won't work. Cause otherwise the mafia player that would be a town player knows his partners.