vstr tells ET to execute a user-defined command, so bind key “vstr your-command” simply tells ET to execute whatever you’ve defined in your-command when you press key. The vstr is required to tell ET that your-command is not a built-in command that comes with the game (cos it’s too stupid to tell otherwise).
The way you define your own commands is to set them, just like any other variable, set your-command “command1; command2” for example.
So defining your own command, and binding it to a key is a 2-step process.
set your-command “command1; command2; etc.”
bind key “vstr your-command”
In the example script, 2 user-defined commands are bound to the mouse wheel. The actual contents of these user-defined commands are themselves defined in the 3 set statements below. The last line, vstr stand, tells ET to execute the contents of the stand user-defined command, which in turn sets the initial values of foo and bar.
It gets confusing because the script defines a command which itself defines a command. This is so the actual commands bound to the keys can be changed dynamically by the script.
Initially mwheelup = foo = prone. But the value of foo is altered by the script, so the action that mwheelup performs is also altered, without having to re-bind mwheelup to something else.
An alternative way of doing the same thing would be:-
bind mwheelup "vstr prone"
bind mwheeldown "vstr crouch"
set stand "-movedown;-prone;bind mwheelup vstr prone;bind mwheeldown vstr crouch"
set crouch "+movedown;-prone;bind mwheelup vstr stand;bind mwheeldown vstr prone"
set prone "-movedown;+prone;bind mwheelup vstr crouch;bind mwheeldown vstr stand"
Clear as mud? 
To get this script to work you might need to alter the order of execution, like this:-
bind mwheelup "vstr prone"
bind mwheeldown "vstr crouch"
set stand "-movedown;-prone;bind mwheelup vstr prone;bind mwheeldown vstr crouch"
set crouch "-prone;+movedown;bind mwheelup vstr stand;bind mwheeldown vstr prone"
set prone "-movedown;+prone;bind mwheelup vstr crouch;bind mwheeldown vstr stand"
One thing to add, as someone has mentioned above, binding stuff like this to the mouse wheel can be a bit tricky because of the way the game interepts mouse wheel “clicks”. Try adding this line to see if it helps:-
seta cg_weaponcycledelay 150
You might even have to increase the number on the end. This is the number of milliseconds that have to elapse whilst turning the mouse wheel before ET considers it’s been turned a 2nd time. If this value were 0 you could find the script doesn’t work because as soon as you turn the wheel it executes stand, crouch, prone etc. very quickly so you end up doing something you didn’t mean to.