The config needs to be valid Perl code, this may help you to find a solution. You could alternatively simply store two configuration files, one with the shutdown text, the other without and move them as
needed into place. This would have the benefit that the operations are atomic and you don't have to deal with requests which get broken configuration data simply because they arrive in the moment were you
save the new file with the new contents and have some milliseconds of invalid perl code.
Said that, why do you think you have to shutdown your Bugzilla installation at all? It's surely not needed for backups of your database as all modern databases are able to do a backup while they are running. Changes to the file system can only occur because administrators change the system configuration, which won't happen very often, if users upload some attachments and you configured to store them in the file system and by running scripts like collectstats.pl. Depending on your configuration all of those may not be a problem for you and you don't need to shutdown your installation.
Depending on your file system you should consider using snapshots, too.