[WARNING: In what follows I discuss usage in "actualization" conditionals—conditionals like your examples, which assert that if the event put forward in the condition occurs then the event put forward in the consequence occurs subsequently. Usage is more complicated in "inference" conditionals—conditionals which assert that the truth of the proposition put forward in the condition entails the proposition put forward in the consequence.]
There is more to this than a was/were distinction.
In this sort of non-past conditional if I was is a widespread colloquial variant of if I were, not a contrasting construction. The contrasting constructions are:
- counterfactual I was/were and factual I am in the protasis (if clause, condition clause), and
- counterfactual I would and factual I will in the apodosis (then clause, consequence clause).
Other things being equal, a non-past open condition—a condition whose factuality is not known—and its consequence are both expressed with the ordinary indicative form; the if is all that is needed to express the uncertainty.
NON-Counterfactual: If I am ... I will
BUT: In this case other things are NOT equal: your use of BE going to in the protasis introduces another twist. You may know already that futurive will is rarely used in the protasis, and the same thing is true of BE going to. These futurives† are not used to express an open condition:
∗ If I will go to the store tonight, I will be sure to pick up milk.
∗ If I am going to the store tonight, I will be sure to pick up milk.
Specifically, these futurives are used only to express a closed condition: a condition known to be factual, or accepted as factual for the discussion at hand.
okIf, as you tell me, I am going to the store tonight, I will be sure to pick up milk.
okIf, as you tell me, I am going to the store tonight, I will be sure to pick up milk.
You appear to specify, however, a situation in which the factuality of your going to the store is open. In that situation you employ a simple present in the protasis, with inferred future reference.
If I go to the store tonight, I will be sure to pick up milk.
† Here and subsequently I specify futurive uses, because will (but not BE going to) has a couple of non-futurive uses which are permitted in the protasis: it may be used to express willingness or assent ("If you will pick up the beer, I'll bring chips") or, with strong emphasis, to express habitual obstinacy ("If you will keep teasing the cat you can't complain if she scratches you").