Hm, not a bad question, but definitely something I've never thought about. I've just been using Reverse Factory at 100% recycling efficiency to recover the original machines and then upgrade them manually.
There should also be a setting to recover the base machine when mining it up ("mini drops as base machine" or something like that), which is generally only detrimental when remote building (like on space platforms or by bots on other planets)
However, I have been thinking of a major overhaul that involves using the scroll wheel to cycle between normal/mini/micro size variants when holding the correct entity, and then just returning the original machine when they get mined up. Though I'm not sure if that would solve the bot/platform construction/deconstruction issues.