Squeezing the bottle is only a good idea if you like flat Coke.
The carbonation is carbon dioxide dissolved in water (or Coke). What “holds” the carbonation in Coke at equilibrium is pressure. Not overall pressure, but partial pressure of CO2 (carbon dioxide). The easy means of calculating partial pressure is to multiply the pressure by the fraction of CO2 in the atmosphere.
SCENARIO 1: Assumptions: 1/3 of a bottle of coke has been consumed, bottle is at room temp, and partial pressure of carbon dioxide in Coke at room temp is 2 atmospheres. Bottle has not been squeezed. “Air” in bottle is a combination of air and carbon dioxide. Once capped, CO2 leaves Coke until fraction of CO2 * pressure in bottle = 2 atmospheres.
SCENARIO2: Assumptions: same as above. Bottle is squeezed before capping. Carbon dioxide again diffuses from liquid until fraction of CO2 * pressure in bottle = 2 atmospheres. The difference this time is that the fraction will be almost 1 since there will be little air in the bottle. However, at anywhere near 2 atmospheres, the bottle will bounce back to its original shape. All the void has to be filled with CO2, then pressurized. (Try it yourself, but shake the bottle to get to equilibrium faster.)
Scenario 1 had a head start on 2. There was already CO2 in the void, so less had to come from the Coke, leaving more in it.
Better ideas for keeping Coke carbonated
Make sure bottle is cold BEFORE OPENING THE FIRST TIME. This has two effects. Unlike solids, gasses dissolve better in colder liquid than warmer (in general). If the bottle is colder when first opened, the partial pressure is lower, so less CO2 is in a gas form, and less hisses out. While open, the CO2 is no longer in equilibrium, but not all the CO2 bubbles out immediately. Colder temps seem to slow the rate of diffusion.
Make sure the bottle remains cold, for the same reasons above.
Don’t agitate the liquid in the bottle before opening or when pouring, as that speeds the diffusion of CO2 out of the liquid.
These tips, especially the first, make a huge difference in how long a 2-liter will last.