The Rabbis emphasized that God is desirous of our repentance and inclined to forgive. In the midrash on Shir Ha Shirim (the Song of Songs) they wrote:
"Open to Me [Song of Songs 5:2]". Make for Me an opening (of repentance), an opening as narrow as the point of a needle, and I will make the opening so wide (for pardon) that camps full of soldiers and siege engines could enter it.
Similarly, they taught that while the gates to prayer (that is, God's willingness to hear prayer) are sometimes open and sometimes closed, the gates of repentance are always open:R. Helbo asked R. Samuel bar Nahman: since I have heard of you as a master of Aggadah, tell me what is meant by the verse Thou has covered thyself with a cloud so that no prayer can pass through [Lamentations ]? R. Samuel answered: Prayer is likened to an immersion pool, but repentance is likened to the sea. Just as an immersion pool is at times open and at other times locked, so the gates of prayer are at times open and at other times locked. But the sea is always open, even as the gates of repentance are always open. [Lamentations Rabbah 3:43, section 9].
From this site. "Gates of repentance" also occurs in Psalms Rabbah, Pesikta Rabbati, possibly midrash on Jonah.
The north portal of the Golden Gate (the east gate of the city wall in Jerusalem) is also called the Gate of Repentance.
Rabbeinu Yonah wrote The Gates of Repentance (Sha'arei Tshuvah) in the 13th century, and the lines from the midrash quoted above are often found in Jewish writings on repentance. There is also imagery from the three High Holy Days: Rosh Hashanah and Yom Kippur, that the gates of repentance are open for these three days, and become locked. Yom Kippur closes with the Neilah service, meaning "locked," of the gates of heaven and book of judgment.
So unless the Orthodox hymn precedes the 5th century AD (following scholarship that suggests Lamentations Rabbah was written over the same period as Genesis Rabbah and the latter is dated to the mid-5th century at the latest), it is likely taken from rabbinic sources, although Lamentations Rabbah also includes a number of Greek words.
Anyone else have any ideas?