Vegas scripts cannot take any action based on the actual content of the video, so there is no Vegas script that can do what you want.
Two options:
1. Use Scenalyzer. This shareware program has optical scene detection which you can operate either at the point when you capture, or after the fact. When you perform the operation on existing AVI file, it will create separate AVI files for each scene.
2. If you know AVISynth (a free program), I have a script that will create a text file which you can then import into Vegas as markers. You can then either split your AVI files at these marker points, or use a Vegas script that I have to split the events at the marker points.