Due to the Task Sequence dependencies troubleshooting custom OSD scripts can be somewhat of a pain. Here are a few basic tips that may not be so obvious...
Here is the back end script that does all of the work. I've made some comments on the script in efforts to keep this post less wordy and more scripty...