Those of you that want a real monoswitch in Vegas, this is not it. It will not be the same as making the final mix mono (but it might, depending on what you've done to it). Just thought I'd clarify that.
It might get an error before it gets to UpdateUI(). You don't check for the type of track - enumerating events on Video track and force-casting them to Audio events may generate an error. Since there is no error handling - it's not reported, but script execution stops.
for (var trk : Track in Vegas.Project.Tracks)
{
for (var evnt in trk.Events)
{
if (evnt.MediaType == MediaType.Audio) evnt.Channels = ChannelRemapping.Mono;
}
}