Is it possible to have/add a menu item or link in the from page that will run an external bash script on the server?
You can not stop Nextcloud. You can configure maintenance mode in config.php or occ or shutdown webserver.
Yes, it is.
Since you can invoke any bash script you want, e.g. with the “File actions” (files_scripts) App, you can do anything you want. Even shut down the complete machine.
However, the prerequisite is that you have full access to the server, are familiar with lua-script and are familiar with editing the sudoers-file, since only the ht-user can execute scripts from that level, who normally doesn’t own the rights to shut down the web server or the system.
It would be easy for me to implement this, but since I don’t see the point of such an implementation, you will have to implement it yourself with this hint.