That's one of the many things that the new Sony Production Assistant plug-in for Vegas Pro 9.0 does as do other plug-ins like Ultimate S Pro and Excalibur, but I believe there is also a free remove gaps script that is floating around the Internet. You just need to search for it. Perhaps someone else here will know where it is.
// step through all selected video events:
var FirstTrack : Track = Vegas.Project.Tracks.Item(0);
// step through all selected video events:
for (var track in Vegas.Project.Tracks) {
if( !track.Selected) continue;
var tracktime = new Timecode(0);
for (var evnt in track.Events) {
evnt.AdjustStartLength(tracktime,evnt.Length,true);
tracktime = tracktime + evnt.Length;
}
}
}