The melody to which "House of four doors / I could live there forever..." in "House of Four Doors (Part One)" and "House of four doors / You'll be lost now forever..." in "House of Four Doors (Part Two)" are sung has some similarity to a phrase in George Gershwin's Rhapsody in Blue.
I still haven't been able to find a complete score for the Rhapsody in Blue, but there are some piano arrangements on IMSLP. Digging through those, I found the phrase (beginning at con moto):
Specifically, it's:
Apparently, this is called the "love theme" of the Rhapsody in Blue.
The phrase in "House of Four Doors" doesn't have much resemblance as far as rhythm, but the intervals of the pitches are exactly the same (save for the end). "House of Four Doors" is just a fifth lower, something like:
Both phrases ascend diatonically, have an octave drop after the first three notes, and then continue upwards again.
Because the Moody Blues recorded the Gershwins' "It Ain't Necessarily So," I'm assuming that they were at least somewhat familiar with George Gershwin's other work and that this might be an intentional reference to the Rhapsody in Blue. I should point out, though, that "House of Four Doors" was written by John Lodge, who wasn't part of the line-up that recorded "It Ain't Necessarily So."
Aside from the possible Gershwin reference, I also noticed that every "forever" sung to this phrase is sung with a melisma (the last four notes: C# C# B B). This provides something of a musical sense of "forever" since the word itself is stretched out.