Should a soda bottle be stored horizontally or vertically?

The volume of the bottle and the volume of the liquid are the same both ways. By subtraction, the means the gas volume is the same either way. The difference assumes in the question’s reasoning doesn’t exist.

There is more area in the sideways case. That’ll let equilibrium be reached more quickly. But it’ll reach the same equilibrium either way.

In an unopened 2L polyethylene terephathalate (PETE) bottle of soda the primary loss of CO2 is by diffusion of the CO2 through the walls of the plastic bottle. If you left a full bottle at room temperature, the half life of this process is about six months, meaning that a six-month old room temperature bottle of soda will be ~50% flat, even if you never open it. After a year, it will be 75% flat.

Keeping the bottle in the fridge naturally slows this process, so a chilled bottle of soda will retain its CO2 for much longer. And, in real life, you're not just watching a full bottle day after day - you're drinking out of it. The vast majority of the CO2 will be lost when you open the bottle. There is likely some differential between the diffusion rates at the liquid/PETE interface vs the gas/PETE interface, but in either case this is a process that takes months to years.

Each time you open the bottle, however, you lose a significant amount of CO2. The partition coefficient for CO2 in water is about 4, so the gas above the liquid will have about 1/5 of the CO2 concentration as compared to the liquid, which will have a concentration four times higher. So your bottle becomes about 20% flatter each time you open the bottle (this is a gross approximation! ***), assuming you leave enough time for it to return to equilibrium after closing the bottle.

So, if you want to worry about keeping your soda from going flat, forget about which way you store it in the fridge - it doesn't matter. What you want to avoid is opening the bottle more frequently than necessary. How flat is your soda? How many times have you opened the bottle? Let's assume you remove 300mL from the bottle each time you open it :

  Openings   Fullness   Cumulative CO2 lost
  One          85%         4.2% 
  Two          70%         13.5% 
  Three        55%         28.2%
  Four         40%         47.8%
  Five         25%         70.2%
  Six          10%         90.8%

*** If we assume, at least, that a serving of soda is removed each time the bottle opens then there will be a ~15-85% fraction of gas/liquid at each opening. When the bottle is more full there will be a lower loss of CO2 as the volume required to be repressurized to equilibrium will be lower - as the bottle empties the CO2 loss per 'opening' likewise increases. A 20% loss of CO2 happens only when the volumes of liquid and gas are equal (ie: half empty bottle). A 75% full bottle would lose only 7.7% of its CO2, for example, but a 25% full bottle would lose a full 43% of its remaining CO2.

According to Henry's law the mass of gas dissolved is proportional to the pressure on top of the liquid. Because the pressure is the same in both cases, it should not matter if the bottle is vertically or horizontally