Not Heresy
That's a great line from a great song. It's a play on words, using "deliver" in such completely different ways. It is saying that Mary would deliver--give birth to--Jesus, the eternal Son of God who became a Man, and then that Jesus would one day deliver Mary, that is redeem her and all mankind from the power, penalty and presence of sin.
So, if it were suggesting that Mary was going to somehow be the savior of Jesus, that would certainly be heretical, but it's not. It's simply using a nuance of the English language in a very poetic and powerful way.
Did Mary Know?
From a biblical perspective (and admittedly not from Catholic writers specifically), we do know what the angel told Mary.
And the angel said to her, “Do not be afraid, Mary, for you have found
favor with God. 31 And behold, you will conceive in your womb and bear
a son, and you shall call his name Jesus. 32 He will be great and will
be called the Son of the Most High. And the Lord God will give to him
the throne of his father David, 33 and he will reign over the house of
Jacob forever, and of his kingdom there will be no end.”
34 And Mary said to the angel, “How will this be, since I am a
virgin?”
35 And the angel answered her, “The Holy Spirit will come upon you,
and the power of the Most High will overshadow you; therefore the
child to be born will be called holy— the Son of God. 36 And
behold, your relative Elizabeth in her old age has also conceived a
son, and this is the sixth month with her who was called barren. 37
For nothing will be impossible with God.” Luke 1:30-37 ESV
So, Mary was specifically told the name of the child would be Jesus. She no doubt understand that this name meant literally, "The Lord saves". She was also told that He would be called the Son of the Most High, that He Himself would reign forever (not just His lineage), and that His Kingdom would last forever. She also knew that He would have no earthly father.
We can also consider the greeting Mary received from Elizabeth:
And when Elizabeth heard the greeting of Mary, the baby leaped in her
womb. And Elizabeth was filled with the Holy Spirit, 42 and she
exclaimed with a loud cry, “Blessed are you among women, and blessed
is the fruit of your womb! 43 And why is this granted to me that the
mother of my Lord should come to me? 44 For behold, when the sound of
your greeting came to my ears, the baby in my womb leaped for joy. 45
And blessed is she who believed that there would be a fulfillment of
what was spoken to her from the Lord.” Luke 1:41-45 ESV
Finally, we have what the angel told Joseph:
Now the birth of Jesus Christ[e] took place in this way. When his
mother Mary had been betrothed[f] to Joseph, before they came together
she was found to be with child from the Holy Spirit. 19 And her
husband Joseph, being a just man and unwilling to put her to shame,
resolved to divorce her quietly. 20 But as he considered these things,
behold, an angel of the Lord appeared to him in a dream, saying,
“Joseph, son of David, do not fear to take Mary as your wife, for that
which is conceived in her is from the Holy Spirit. 21 She will bear a
son, and you shall call his name Jesus, for he will save his people
from their sins.”
Joseph was given the specific reason why He would be named Jesus--because He would save His people from their sins. This was pretty significant, and it is at least likely that Joseph shared this with Mary in explanation as to why he decided to go ahead and take her as his wife.
Mary was also part of a culture that had received the promises of a Deliverer.
So, from a biblical perspective, it is quite likely (at least) that Mary did have an understanding that Jesus would one day "deliver her" and the whole world from the power of sin.