A service has a Start and Stop functions. Stop function is executed upon shutdown. You can leave the start function unused if you like so that it functions solely as a shutdown service.
If you need a "nice" (ie orderly) shutdown, script it (shell, applescript, automator workflow, or any combination).
# what to do on boot (can be empty)
# what to do on shutdown (can be empty)
This file has to be executable, i.e. chmod a+x filename. Then create a file by the name StartupParameters.plist with the following contents:
Description = "Name of your service goes here";
Provides = ("Whatever your service provides goes here");
Uses = ("Disks");