A shortcut can be used to set certain System Settings, and the following is a simple example. It allows the user to enable a Do-Not-Disturb setting for a specified number of hours and to disable a current Do-Not-Disturb setting.
The shortcut included below allows the user to select either hours or minutes. An existing Do Not Disturb setting is not overwritten and an error is instead reported. The swiftDialog app is required (here).
The following shortcut is similar to the above but uses swiftDialogs throughout and includes additional error handling. The screenshot only shows a portion of the shortcut.