"Pensé que había cerrado la puerta."
Translation:I thought that I had closed the door.
It could not. As "había" is both 1st and 3rd person, it will semantically attach to the last subject it fits, which, in this case, is the 1st person implied by "pensé". If you want to express that a 3rd person did the closing, you will have to disambiguate by spelling out the subject (él / ella).
Either would be correct if you leave the "a" out of the first one. In fact, I'd prefer that one in many cases, since it gives emphasis to the él.
But you can't leave the "a" there. He is the SUBJECT (the doer) of the verb "había cerrado," and you don't mark subjects with "a."
I disagree that it couldn't mean this—I think it depends upon the context in which the sentence appears.
When using the imperfect indicative, there is ambiguity between the first person singular and third person singular forms. Therefore, the appropriate noun/pronoun must be used. If not, the meaning is the passive. So in this sentence, the correct translation is "I thought the door had closed", not "I thought that I had closed the door".
"I intended to close the door" would be "Pensé (or pensaba) cerrar la puerta." With the había cerrado, it wouldn't work to translate it that way.
Pensar can be used for intention in any tense: Pienso ir a la playa mañana. But in that sense, it will always be followed by an infinitive.
They're similar, but not the same. Imagine: When I was 10 I had never flown. Now, I have flown many times.
The points of reference are different: "had done" compares to a point in the past, whereas "has done" compares to now. There may be instances where the meaning doesn't change much between the two, but the tenses are rightly distinguished.
Same: "I have never suffered so much" (up to now), and "I had never suffered so much" (up to the point that that happened to me, or up to the point that I compared my suffering with someone else's).