In episode 20 of UBW (or episode 8, UBW 2nd season), Kirei announced that he would take Rin's heart.
First, that was episode 19. Second, he says complete opposite thing. He says
"The vessel has no need for a heart." This implies that he wants her body except her heart.
In episode 20, we see what he meant, when
Gilgamesh pushes Illiya's heart inside Shinji, turning him into vessel and using him as way to "anchor" the grail to this world.
The reason for this is that
Grail needs two components, first it needs the core. In Fifth grail war that is either Illiya's or Sakura's heart. And it needs a vessel to anchor it to real world. Vessel can be any body with enough magic circuits. Normally, Illiya herself works as both core and vessel, but for some reason Gilgamesh didn't want that, so he only took the core. And at the time, Rin is only actual mage nearby, making her best option for a vessel. But when in episode 20 she regroups with Saber and Shirou, he could no longer get to her, so he went with next best option : Shinji. Even though his magic circuits are pretty bad, he is still a magus.