Do you say "I wish I was there" or "I wish I were there"? Do you say "If I was you" or "If I were you"? Whether you say was or were in such constructions, you have company. Actually, you should say were in both quoted sentences, even though was and were are alike in that they form the past tense of the verb be. It's a question of mood, the state of mind or the manner in which a statement is made: a fact (indicative mood), a request or command (imperative mood), à condition or probability (subjunctive mood).
The subjunctive mood (here the form were) is generally used to express (1) a condition contrary to fact, (2) a supposition, (3) an improbable condition, (4) uncertainty or doubt, (5) necessity, (6) parliamentary motions, and (7) a desire. In "I wish I were there" the subjunctive were is standard because "I" is not there (a condition contrary to fact) and also because the speaker is expressing a desire. One of the same conditions applies to the second quoted sentence. Use were (the subjunctive), not was (the indicative), in such sentences as these: "Suppose he were to arrive now" (supposition)."He drank ale as if it were going to be prohibited forever" (an improbable condition)."Roberta wishes that she were going to be invited" (desire). Now that these distinctions have been made, you can relax in the sure knowledge that was is heard at least as often as were in statements such as those cited.
Dictionary of problem words and expressions. Harry Shaw. 1975.