First, (if you haven't already) try flushing all sessions, and manually deleting all files in the core/cache directory before testing.
Second, are you sure it's not breaking the system because your settings aren't correct? That is, if you replace the tags manually, does everything work correctly?
Third, if you're sure the tags are correct, replacing them manually fixes things, and they are already in place, and the master_domain Context Setting has been set for each context, I would write a small PHP utility snippet to replace them. Something like this (off the top of my head, and untested):
$searchString = '[[++master_domain]]';
// Try it on one or two contexts
$contexts = $modx->getCollection('modContext', array('key' => 'SomeActualTestContext'));
// If it works, replace that line with this one: $contexts = $modx->getCollection('modContext');
foreach ($contexts as $context) {
$key = $context->get('key');
$masterDomainSettingObject = $modx->getObject('modContextSetting', array('key' => 'master_domain'));
$masterDomain = $masterDomainSettingObject->get('value');
$settings = $context->getSettings();
foreach ($settings as $setting) {
$value = $setting->get('value');
if (strpos($value, $searchString) !== false) {
$value = str_replace($searchString, $masterDomain, $value);
$setting->set('value', $value);
$setting->save();
}
}
}