the only way to respawn as a different unit type is to use group respawn and have the unit class alive before you actually die
as for swapping sides.... most unlikely, as the unit you are bspawning into, has to be in your group and that means on the same side as you.
it may be possible to join groupname to a group on the opposite side once you had respawned, i've never had a need to do that