This is purely speculative, but one reason masturbating MIGHT affect gains could be L-arginine. I read in another thread that someone was using that protein for working out, since it helps production of nitrous oxide or something, which helps to expand the blood vessels and bring more oxygen and stuff to the muscles.
So, could it be possible that this protein would also prove beneficial to jelqing, in maintaining blood supply and nutrients to the penis post-exercises (think this was one of the hypothesis of that thread).
So after looking up L-arginine, I found out ejaculate is composed of this same protein. So it seems counter intuitive to expel a concentrated amount of a substance that could potentially help you build up size.
I am not a medical student, so I have no idea how valid this idea is, and there are lots of questions, like how much L-arginine is in jizz, does it affect your overall level in your body, does it even help length/girth gains, what is the time window where you would need it to be effective pre/post routines, etc. Etc.
Better safe than sorry, no harm in waiting until rest days, I say.