Here's why it's correct:
* "Were" is the correct verb conjugation for the subjunctive mood in this context, even though the subject is "I" (which normally takes the verb "was").
* "If I was dreaming" would be grammatically incorrect in this sentence because it uses the indicative mood, which is used to express factual statements.
Example:
* "If I were dreaming," I would be flying over the clouds. (Subjunctive mood, expressing a hypothetical situation)
* "If I was dreaming," I wouldn't be here right now. (Incorrect, as it uses the indicative mood to describe something that is not true)