first off, is your 4" pipe pressure rated? if it isn't, don't use it for this, or you could be seriously injured. if it is pressure rated, it will say so right on the side of the pipe. i believe that 4" sch 40 pipe is rated to 220 psi. pneumatic guns may contain twice as much pressure as combustion guns, so you really want to do this right. when you start doing the math, the forces that are in play here are pretty frightening. if 4" pressure rated pipe is hard to find, 4" pressure rated fittings are at least twice as rare. fittings tend to be stronger than pipe (in my experience) and i have used sch 40 cellular PVC fittings without problems, though i wouldn't recommend it. you should do the safest job possible on this, as it is your health and well being on the line.
ok, safety talk done. 4" pipe holds 4x as much air as 2" pipe for the same length, so if you used 2 ft of 4" chamber and 4 ft of 2" barrel, you would still have a 2:1 ratio, which would work nicely. larger C:B ratios are better, though as the ratio increases, the gain decreases. (what i am about to say assumes no restrictions from a valve, it is just for an understanding of C:B ratios. in reality, valves screw up these numbers significantly. the idea still holds though.) for instance, with a 2" barrelled gun with a 2:1 ratio charged to 100 psi, there will be 314 pounds of force on your projectile when the valve opens. when the projectile is just leaving the barrel, the force behind it has dropped to 209 pounds. with a 4:1 C:B ratio, there is also a 314 pound force behind the potato when the valve opens, but when it leaves the barrel, there is a 250 pound force pushing it.
the best solution to the question you asked is to make an over-under gun rather than the linear combustion gun you probably have experience with. decide the maximum length you would like your gun to be, and use that length for your barrel. make your chamber as long as comfort permits (using 2" and 4" pipe, it should be at least 1/2 as long as the barrel), and suspend it below the barrel with hose clamps and wood or plastic braces. (2 hose clamps can be hooked together to go all the way around.) connect the two with plumbing and poof, you've got a gun.