One thing to remember is that a barrel length of maximum velocity will not have maximum accuracy, and vice versa. The target rifles with really long barrels do not have very high velocities. In fact, they are meant to have slow subsonic bullets. It is my understanding that when the small 22 bullets travel through the sound barrier they are subjected to accuracy impairing turbulence. The subsonic target bullets are more accurate because they avoid the unpredictable effects of decelerating through the sound barrer.
I have heard 16" is about the ideal length for .22 velocity, but longer should in theory be more condusive to accuracy.
If you really want to hit gophers hard at long distances, you may want to look into the .17 rimfire rounds.