When restarting Home Assistant, there is a nice warning telling you “This will interrupt all running automations and scripts.”
Sometimes a restart is required by the update of a custom component, a change to configuration.yaml or anything else but the currently running automations/scripts are more important than this restart.
It would be nice to have them listed on that popup so that you are aware of what will break and potentially postponing the restart to another time.
Further more, there could be a checkbox to wait for no running automations/script before restarting automatically.
Or if we want to have mode flexibility this checkbox could trigger an event that you could listen to in an automation and do whatever checks or actions you want before calling a restart of Home Assistant.