You are talking about hooking into Operating System to trigger the script when a shutdown is initiated. This type of functionality will not work well with a scripting language like VBScript which is designed to be lightweight and has no hooks into the Windows API.
This type of task is better suited to a fully featured language like C++, C# etc. If you are familiar with VBScript, you might have some success using VB.Net due to the similarity in syntax.
Closest you will get with VBScript is having the script itself initiate the shutdown rather than hooking into the Windows API, which is discussed in the question Yes/no shut down.