Govic,
I looked into the code you posted and found a few things that needed to be fixed.
Here is a link to my version of the shutdown timer function added to ServerTools 3.2 compiled and ready to go.
https://github.com/schwanz9000/ServerTools3.2withShutdownTimer/releases
This will check admin permissions which must be level 0 for the /shutdown command to start. Once started, it will start a 10 minute timer counting off each minute and then the last 30, 10, 5, 4, 3, 2, 1, seconds.
NOTE TO ALL: If you have a rented Blue Fang Solutions dedicated server, they already have a server side script that automatically restarts the server. If you want to stop the server for a period of time, you must use their dashboard stop button.
These files are written and compiled in Microsoft Visual Studio. You can get a free fully functional version for private use here.