I used 2 1 1/2" PVCs on a 2x4 and it fits perfectly because 2x4s arnt actually 4" wide. There like 3 1/4 or something like that. Trust me my dad used to be a framer and ive built way to many things.
As for the lenfth of the rail i would go as long as you can. I built a 10 and its too short for pretzels and stuff. Mainly cause i get a ton of speed on my drop in and my rail is slightly down hill. Im building a 20 ft rail tomorow though :)
When you fall you always need to make sure you land in your afterbang position for maximum steeze - Traveling Circus