You can create a new Derived Property as u said and use that instead of the Defined Property in your exports or wherever You will have to refer to the colour. The defined property can be used just to take user inputs.
The new derived property should have a logic like this-
Now, in 184.108.40.206 I have lost memory of how properties are referred to- if they are just used with their names or the namespaces is mentioned (Core. , Custom.). You can modify the formula accordingly to refer the properties
So, if SharedFlag_MDM is True then it will take the property value of its Primary Node which is inherited from the Primary Parent and if the Shared Flag is False then its just a PropValue on the node itself.
I hope this answers you.