have a common profile setting which target a profile (by default named "Common")
When changing profile it would merge the common and selected settings and extensions to apply.
When saving it will compare the settings in the Common part :
if the setting is different it would save it to the selected profile.
if the setting is no more existant, it would remove it from common part and add it to other profiles.
if the setting is identical in all profiles, it would remove it from them and add it to the common part.
Simple suggestion either way :
When changing profile it would merge the common and selected settings and extensions to apply. When saving it will compare the settings in the Common part :