My 2 cents ...
Sometimes not best to use a Moodle plugin ... am thinking this is one of those.
Moodle's are normally accessed asynchronously ... students/teachers in courses at any time. Then there is the tendency for folks to do something just before the deadline ... quizzes, assignments, etc. So ... bottom line ... there is no 'good' time.
So how about establishing a standing maintenance window of time ... like the least usage days/times? To do that, however one would have to kinda know when those were.
If you have something installed on server like webalizer it does a report showing dates/days/times of usage. Naturally, when the majority of folks are sleeping, server is used less. Not sure I'd want to volunteer to always do maintenance work on a server 2 AM on Sat. or Sun.
So, on one K12 instance have established a maintenance window ... every Sat afternoon. Why then? Least usage at a reasonable time ... notice is on front page and says:
Attention: Server Maintenance Window: every Saturday afternoon. Advise taking break and if you have something to do on Saturday, do it AM or after 5PM.
Even with the notice there are still students and teachers doing something.
In a 'last5' query of DB + watching realtime logs to see what folks are doing,
one could wait hours for no traffic. If what you have to do involves a 0 day flaw or an update/uprade to the OS, apache, php, or mysql, then what 'trumps' (no pun intended)?
If updates and upgrades to a moodle under git have been tested with a clone of production site then one knows if there any issues/catch 22's that need to be addressed.
Git updates and upgrades usually take just a few minutes. And yes, I do have those scripted to do via command line and the first things those scripts do:
minimal site backup
runs cron
puts site in maintenance mode
performs update or upgrade
takes site out of maintenance mode ... at which time I check with browser.
So ... don't think you can please everyone. Give a notice.
Do what you must do.
LIke I said ... my 2 cents.
'SoS', Ken