These are both unreal conditional sentences, and unreal conditionals are formed by a past tense verb form in the if-clause and a past tense modal verb in the then-clause. Thus, in unreal conditionals, the past tense form does not talk about past time, but present unreality.
The past tense form I were is used only in unreal conditional sentences.1
The two bolded instances of going to might look the same, but they are actually two different things, using two different verbs.
1 If I were going to Rome next week, I would be trying to find accommodation.
In sentence 1, were going is a past progressive form of the full verb to go. It is never pronounced gonna. The to here is the preposition that begins the prepositional phrase to Rome. The present progressive form is I am going to Rome next week.
2 If I were going to go to Rome next week, I would be trying to find accommodation.
In sentence 2, were going to is a past tense form of the semi-modal be going to. This semi-modal can be pronounced, and written informally, as gonna. It is followed by a verb in the base infinitive form: here the verb is go. This is followed by the same prepositional phrase to Rome. The present tense form is I am going to go to Rome next week.
In Sentence 1 what is not real is my going to Rome. The full verb to go is an action verb. Hence, it is an action that is unreal.
If I were going (traveling) to Rome next week (but I'm not), I would...
In Sentence 2 what is not real is my going to go to Rome. Be going to here does not express an unreal action. Here it most likely expresses an unreal intention. This is very close to
If I were intending/planning to go to Rome next week (but I'm not), I would...
Let's use a different verb to get another look.
If I were selling my bicycle, I would...
(a past progressive form of to sell) expresses an unreal action.
If I were going to sell my bicycle, I would...
(the past form of am going to using were, plus base infinitive of the full verb sell) expresses the unreal intention of selling my bicycle. In this usage, it is very close in meaning to
If I were planning/intending to sell my bicycle, I would...
Note that besides
intention, the semi-modal
be going to can express other things. One is inevitability:
John is going to go to hell.
Here is going to probably does not express so much the intention of John to go to hell, but the inevitability.
This inevitably can be expressed as an unreal condition:
If John were going to go to hell, the devil would have sent him an invitation by now.
When does be going to express intention and when does it express inevitability? Like just about everything: context and speaker's intent or purpose.
1 "The form were may be treated just as an alternative irrealis form of [the past tense verb] was rather than a past subjunctive" (Wikipedia). Note many bona-fide linguistics say that English has no subjunctive–or at least that English does have a subjunctive in the same manner as Latin (from which the term was probably unfortunately borrowed) has.
Geoff Pullum: "People often call the "were" of "I wish I were" subjunctive, but that term is much better used (as in The Cambridge Grammar of the English Language) for the construction with "be" seen in "I demand that it be done." The "were" form is often wrongly called a past subjunctive, but of course "it were done" is not a past tense of "it be done". The difference between the two is that the subjunctive construction occurs with any verb: "I demand that this cease" is a subjunctive (notice "this cease", not "this ceases"). The relic form in "I were" is only available for "be". For all other verbs you use the preterite: "I wish I went to New York more often." The Cambridge Grammar calls the "were" form the irrealis form. It is surviving robustly in expressions like "if I were you", but even there it has a universally accepted alternate "if I was you", and there is no semantic distinction there to preserve."