Here's another version:
http://nvdata.pilif.ch/VBA-rerecording-new4.zip
I tried fixing the video skew and un-offsetting the sound offset, but right now I can only guess that these work as intended.
(For when you're not recording, any delay is probably due to latency in emulating DirectSound or something. I've never experienced a sound delay that could be noticed when listening at 100% speed, and of the few frames of delay there are, I think some/most of that is really supposed to be there. EDIT: OK, perhaps I'm wrong about that, I just tried Shanedudddy's version instead of the official version and noticed the sound delay of 6 frames or so is gone, I'll take another look at what changes he made... EDIT2: On further investigation, the only reason you could hear sound effects at exactly the right frame before was because the sound kept playing in a loop on frame advance. There is no way around the fact that the sound that plays from a sound buffer must be delayed by the sound buffer length, which is currently about 6 frames. I could make the buffer length configurable, however, so making it shorter would reduce sound latency, but for now that's not necessary, it can't affect the AVI anyway.)
Also, in case you still wanted to know this: The sound is always 44100 Hz, 16-bit, Stereo. And I just verified that VBA emulates all games at 60 fps.