If you want to achieve best possible results at a certain target file size, then you really have to use a more flexible encoding program. The problem is this requires much more effort to learn & use. AutoGK for instance, is a simplified variant of Gordian Knot which lacks the flexibility [I]but[/I] is much more beginner friendly. For MPEG-4 encoding, I prefer to encode with AVC/H.264 rather than XviD/DivX as I find it much easier to obtain perceptually lossless (to my eyes) results at a reasonable output size compared to DivX which gives me a headache trying to achieve the same.
The negatives of using AVC is that the files have only limited standalone support & require more powerful hardware to encode/decode. If you have a fast PC, I would suggest you may wish to experiment with AVC/H.264 encoding as it has much better general encoding effiency compared to DivX. Preprocessing of your sources is the same for encoding to both DivX or AVC.
These forums are where you are likely to find the most useful information:
Try these threads for some tips on resolution & XviD (which is generally considered to be slightly superior to DivX for quality).
A nice program which supports both XviD & x264 (AVC) is MeGUI which is very flexible and can show you how filters can affect the encoding.
Good luck with your project, learning these things may take a period of time & practical experimentation is the best guide to what will work in your situation.