Controlling the volume (or, in this case, mute setting) is trivial. It's literally one line:
set volume with output muted
Triggering this to run when the system is about to shutdown is a whole other story. There is no built-in trigger to run a script at shutdown (at least without digging under the hood).
The simplest solution would actually be to have a stay-open script that sits in the background and does nothing until quit, at which point it mutes the volume before quitting. This way you can leave it running in the background and when the OS quits the app (as part of shutdown), it mutes the volume. It would have the side effect of muting any time the app quit, though, whether through shutdown or some other method.
The larger question, though, maybe why you're shutting down at all. The MacBook (like all laptops) is designed to sleep for an extended period, and waking the system is not only faster, but it doesn't play the startup chime. So maybe that's a better alternative?