You need at least to give a Script handle name “MIDIin” to your MIDI in block , and widgets with names “VolumeWidget”, “BalanceWidget”. You also need to autodeclare (have a look to the menus when in the script editor) these names at the beginning of your script. I didn’t look at the gigfile given by @simon, but I am sure you will find everything you need in this file.
Indeed. But as it is also possible to react to changes in widgets, it is very well possible to map the MIDI input to a widget, read that from GP Script an control the other widgets from there. This has some advantages (for example being able to use the rig manager for that).