Matthew 20:28: "'Even as the Son of Man came not to be served but to serve, and to give his life as a ransom for many.'"
Matthew 21:5: "'Say to the daughter of Zion, "Behold, your king is coming to you, humble, and mounted on a donkey, and on a colt, the foal of a beast of burden."'"
1 Timothy 2:6: "[Jesus Christ], who gave himself as a ransom for all, which is the testimony given at the proper time."
Psalm 49:7-8: "Truly no man can ransom another, or give to God the price of his life, for the ransom of their life is costly and can never suffice."
Revelation 5:9: "And they sang a new song, saying, 'Worthy are you to take the scroll and to open its seals, for you were slain, and by your blood you ransomed people for God from every tribe and language and people and nation.'"
+++
The text is public domain:
Come, Thou precious Ransom, come
Only hope for sinful mortals!
Come, O Savior of the world!
Open are to Thee all portals.
Come, Thy beauty let us see;
Anxiously we wait for Thee.
Enter now my waiting heart,
Glorious King and Lord most holy.
Dwell in me and ne'er depart,
Though I am but poor and lowly.
Ah, what riches will be mine
When Thou art my guest divine!
My hosannas and my palms
Graciously receive, I pray Thee;
Evermore, as best I can,
Savior, I will homage pay Thee,
And in faith I will embrace,
Lord, Thy merit though Thy grace.
Hail! Hosanna, David's Son!
Jesus, hear our supplication!
Let Thy kingdom, scepter, crown,
Bring us blessing and salvation,
That forever we may sing:
Hail! Hosanna to our King.
+++
Four of the five cited texts mention a "ransom," but because of the resemblance between "Open are to Thee all portals" and "Worthy are you... to open its seals" it seems that the Revelation text is the primary referent.
The third and fourth verses - with their calls of "Hosanna" and the mention of palms - hint at Jesus' entrance into Jerusalem (which the Matthew 21 text, quoting Zechariah 9:9, precedes), but they're more than mere references. It's more like the hymn uses that imagery in describing current "homage" paid to Christ.