Swap portal with original rem

It would be nice if there were a feature that enabled a user to swap a given portal with the rem to which it points (i.e. if I have A/my_rem, B/portal(my_rem) and C/portal(my_rem), then calling this function on the portal in B would convert the structure to A/portal(my_rem), B/my_rem and C/portal(my_rem))