As soon as I finished writing my last post I thought of a different way to handle the issue of reconciling newly created units with temporary ones. Rather than removing the temporary unit and copying its content to the new unit, I just keep the temporary unit and then dispatch any changes to it as if it were from the real unit by referencing the real unit's id rather than the temporary id.
It was pretty annoying and took two hours to write, but it works much more smoothly now and no content is lost, nor is is it prohibitively laggy.