Take a look at the vb tutorial section for
how to create a vb powered webpage.
That will give you the tie in to use the vb header and footer to call a template.
You can add most of your script in to the body part of that tutorial but I think you'll need to strip out the echos and call that via the variable in the template.
Hope this helps. I am curious to see how this turns out.