I think I got it now. So, even if the door is now not locked the answer 閉まってた is still legit right? since that answer is refers to the moment I checked it.
Exactly! You got it right. For example, if they are requested もし閉まってたら開けといて "if the door is locked, please unlock it", the answer 閉まってた actually means 閉まってたから開けておいた "the door was locked, so I unlocked it", i.e., 今はもう閉まっていない/開いている "the door is now not locked" in this context.
In this sentence その船が荒れた海で揺れているのが見えた。if I change it to その船が荒れた海で揺れていたのが見えた。will a nuance of the sentence change? I just don't understand why 揺れている is being used while the main verb 見える is in the past form, I understand now that 揺れている and 揺れていた both give almost the same meaning but refer to the different moment (and we don't know if the boat stop shaking yet in both cases)
As I wrote "The past/past progressive form doesn't always express the tense of the action in a modifying clause" in my initial reply in this thread, the tense of a modifying clause doesn't have the same function/meaning as the tense of the main predicate like 見えた or 下がってた. 揺れている and 揺れていた are the same in meaning, and both refer to the same moment (when the subject saw the boat) in that sentence. (Well, actually, although 揺れていた is also OK, 揺れている is more common because of 見えた. This verb shows that the speaker's viewpoint is on the moment they saw it, and the boat was shaking at the time. On the other hand, the viewpoint is now (when they are speaking) for 揺れていた, so 揺れていた is also valid.)
Incidentally, please refer to the following example.
来週嵐が来れば、その船が荒れた海で揺れているのが見えるだろう。
揺れていたの can't be used here since it's the future tense, and the movement of the boat is not past even from the viewpoint of utterance. (On the contrary, all of 荒れた海, 荒れる海 and 荒れている海 work well also in this sentence.)