how do you process mdg.php files during an extension upgrade?
I think invoking below method in your extensions Upgrader.php incrementalupgrade function will re-build all your managed entities from all extension.
CRM_Core_Invoke::rebuildMenuAndCaches();