Refinery Stats can be found by putting in each state and manually counting up.
Montana: 4 Refineries
Wyoming: 5 Refineries
Virginia: 2 Refineries
So How much does a person pay per gallon per refinery?
Montana: 2.11$/g / 4 Refineries = 0.52$/g per Refinery
Wyoming: 1.98$/g / 5 Refineries = 0.39$/g per Refinery
Virginia: 1.81$/g / 2 Refineries = 0.90$/g per Refinery
So, clearly, Virginia's low gas price isn't related to their sheer number of Refineries. And being landlocked isn't a big factor as Wyoming is as landlocked as Montana in relation to sea ports. Could another refinery make up for the difference? Probably, as it would be a drop of about (2.11/5 - 0.39) 0.03$ per gallon per refinery.