I'm not a Catholic, so perhaps you'd explain this a bit further to me?
Catholics believe that you can be forgiven if the Priest repents for you? Protestants believe you must personally repent of your sins - is that not necessary if one is Catholic?
Is this sort of like Mormons baptizing dead ancestors by proxy so that they can see those ancestors in heaven?
No the Priest prays that your sins may be forgiven. He doesn't repent for you.
"Is any man sick among you? Let him bring in the priests of the church and let them pray over him, anointing him with oil in the name of the Lord. And the prayer of faith shall save the sick man. And the Lord shall raise him up: and if he be in sins, they shall be forgiven him." (St. James 5.14-15)
We Catholics tend to take the Bible very literally. The above seems abundantly clear to me. We take this as the Biblical warrant for the Sacrament of Annointing of the Sick or Extreme Unction. The specific prayer of the Sacrament is:
"Through this holy annointing and his most loving mercy may the Lord forgive you of whatever evil you have done."
That is the prayer that we believe effects the sacrament (like the words "I baptize you in the name of the Father, etc." make you bebaptized).
The Priest also prays: "We beeseach you, our Redeemer, by the grace of the Holy Spirit to heal this sick man of the illness that afflicts him. Cure his ailments, forgive his sins; rid him of all pain of mind and body. Mercifcully restore him to full health in body and soul so that, made whole by your goodness, he may again go about his daily life and work."
Normally a person would confess their sins before daring to receive one of the sacraments, but if they are already unconscious, we believe that they certainly should be annointed before they die, and we believe that this will effect the forgiveness of their sins because that is what we believe the Bible says.
Is this sort of like Mormons baptizing dead ancestors by proxy so that they can see those ancestors in heaven?
We don't believe that the dead can benefit from the grace of God anymore since: "it is appointed unto men once to die, and after this the judgment" (Hebrews 9.27), so I wouldn't really think of them being similar at all, although I can see where it might seem so from your perspective, since you are condiering the jointly held belief in the working of God's grace from the action itself, rather than from the belief prompting one to the action (i.e. we believe that Baptism itself regenerates the person, not the faith which impelled them to seek out the Sacrament).