Not sure it's a "design pattern", but I would classify that type of behavior as end state configurationend state configuration or desired state configurationdesired state configuration, in the vein of Puppet, Chef or Powershell DSC. Typically those
Those solutions typically operate at the systems management level, not a business logic level as the question describes, but it's the effectively the same paradigm. Most, and although such tools are usually declarative in nature, but there's no reason the same principles can'tcan be applied in procedural code/scripts, as the question implies or scripting.