There is one other irony near the end of the speech.
Portia points out:
... Therefore, Jew,/Though justice be thy plea, consider this:/That in the course of justice none of us/Should see salvation. We do pray for mercy,/And that same prayer doth teach us all to render/The deeds of mercy.
"In the course of justice none of us should see salvation" is an excellent summary of basic Christian doctrine, and there is some truth in the caricature that Christianity emphasizes mercy (or "grace") while Old Testament Judaism emphasizes justice (or "law").
However, the concept of mercy is not foreign to the Jewish Scriptures. To take just one of many examples, here is an excerpt from Psalm 130:
O Lord, hear my voice./Let your ears be attentive to my cry for mercy./If you, O Lord, kept a record of sins, O Lord, who could stand?/But with you there is forgiveness; therefore you are feared.
With Scriptures like this, Shylock could certainly be a man of mercy and still be a consistent Jew. However, he is unaware of his own need for mercy. He thinks of himself as someone who has never demanded more than his due, and who is now asking for simple justice. He is not aware of ever having had mercy extended to him. Therefore, he feels no mercy for anyone else.
Portia is aware, though Shylock is not, that in just a few moments Shylock is going to be pleading for mercy. After she uses the technicalities of Shylock's agreement (or "bond") to show that he cannot legally take a pound of flesh from Antonio, she will show that Shylock's obvious attempt to murder Antonio puts him in the position of being fined all his goods. She will then ask Antonio to show mercy to Shylock.
When Portia speaks to Shylock of the beauties of mercy, she is giving him a chance to embrace it for its own sake, without any obvious mercenary motives. But, like most of us, Shylock cannot see the beauty of mercy until he is in a position where receiving justice would ruin him. By pointing out that "we all need mercy," Portia was trying to get Shylock to see that in having mercy on another person, we are setting a precedent for someone to have mercy on us. In pardoning another, we are pardoning ourselves. Or as a very famous Jew once said, "Forgive, and you will be forgiven. For with the measure you use, it will be measured to you." (Luke 6:37 - 38)
Though it is not obvious from the rest of the play, this speech indicates that Portia herself must be aware of her own shortcomings and her own need for mercy.