don't encode your video with vegas (or any editing program for that matter)
and using divx will often leave you wishing for something else.
and then do your final encoding per these instructions
the guide goes over vegas 4.x/5.x but at the very least, the ideas will stay the same for 7.x (that is, export with a lossless codec or uncompressed)
just remember, you can only get out what you put in (which means if your source looks bad so will your final product)