You think he was just planning to get up there, yell at him and then come back down? He planned to kill him. Shae was of course an accident (the bitch had it coming though).
Um, okay, I guess you've stopped using Spoiler tags now.
It wasn't clear as a viewer what was going to happen. I didn't read the scene until after. So I'm going by my perception -- it was ambiguous at first. He does choose to take additional bolts for the crossbow + the claw so he can reload, but the way the scene with Tywin plays out, it's almost like Tyrion is wrestling with things -- rationally he thinks it makes sense to kill his dad but where it leads him is to set things up so that Tywin himself utters the words that justify Tyrion pulling the trigger.
My points are:
1 - Tyrion wouldn't betray Jaime's trust for no good reason. As I said, killing Tywin puts all the guilt and possible consequences in Jaime's shoulders.
Meh. I don't think Tyrion saw it as "betraying Jaime's trust." He was planning to leave, then turns around. Tyrion in the show isn't cast as a killer. I think he's more "P" and as such he tends to come up with rational answers but kind of needs something to "push him" into doing what he thinks he should do.
I'm more curious to see how Jaime will respond. That will determine what the show meant to accomplish by Tyrion's action, if anything.
2 - Tyrion gains nothing by killing Tywin. If anything: he endangers himself. He would only do it if posessed by a sudden rage.
Um, Tyrion's a strategic thinker. He's fully capable of arising to a conclusion rationally, in terms of short-term vs future good. And what he realizes is that his father has always wanted him dead and he will always be unsafe as long as his father lives.
It's the very first thing Tyrion makes Tywin admit when he goes to see him. Tyrion has reached this conclusion but wants it confirmed. And Tywin confirms it.
Then Tyrion sets his father up to trigger his own death. If he had just wanted to kill him, he would have killed him. Instead, when Tywin calls Shae a whore, Tyrion spontaneously chooses that as the line to not be crossed: If his father calls her a whore again, he will shoot him. I'm pretty sure he knows his father will do so, so it's a safe bet, but it gives Tywin a little agency in his own demise, it provides Tyrion with some confirmation that killing dad was the right thing to do.
EDIT:
I think the wikia on this is pretty insightful, especially this aspect:
...
Over the years, Tywin seemed to develop an outright joy in inflicting petty humiliations on Tyrion, such as "rewarding" him on his sixteenth nameday by putting him in charge of the privys and sewers at Casterly Rock. Yet despite all this, Tywin is blind to the true potential his son Tyrion has within him. Due to this, Tywin can't see that through his son Tyrion mirrors that of his own abilities and motives. In a way, Tyrion is Dorian Grey's mirror to Tywin: having Tywin's abilities he mirrors and deforms Tywin's ugly abysses in Tywin's eyes, his deformity symbolising Tywin's inner nightmares, his deeply hidden superstitious fear of the Gods, his carefully covered up lust and Tywin's nonexisting joy of life.
Out of all three children, ironically, I think Tyrion is the one with the intellectual gifts most like his father. Yet the circumstances of his birth and his physical shape have led his father to loathe and reject him, he projects all of his own pain and fears and self-loathing unto the child who he had the most in common with.
EDIT2: Also, I suppose we could discuss the ways in which the show changes Shae from her persona in the book to make it more allowable for Tyrion to murder her, so that we feel sympathy for him and "what he had to do." The books I think present a less sympathetic view of Tyrion. The book Shae is more calculating (her betrayal is "all business"), while the show Shae's betrayal is very personal, culminating in her become Tywin's sexual partner -- the ultimate betrayal justifying her death at Tyrion's hands. The show even has Shae drawing a knife on Tyrion first, a weapon they fight over, so it comes off as self-defense; in the book, she presents no physical threat and he just chokes her to death because he realizes she never loved him.