After only one viewing, I have a different spin on the finale, which doesn't make it seem AS bad, at least in my mind. I don't like taking it at face value, because then it just seems very poorly written, and tres cliche.
I think Castle realized that Beckett has feelings for him after he told her he was leaving, and she had that moment of awkwardness. I almost felt bad for her when Esposito walked in and she couldn't quite focus on what he was telling her about the case. I think that was Castle's lightbulb moment that made him think he might have a chance after all.
Two random things I picked up on that might be important. Martha telling Castle that she can't just let Chet think she will always just be there waiting for him (after she told Castle about getting the part and going away for the summer).
Another was when he told Alexis he wouldn't be alone for the summer. She asked who, and he said he doesn't kiss and tell. (I say, since when??) This may seem like some foreshadowing to him spending the summer with Gina, but I don't think so.
I think he is playing a game. I know, you would think he would learn by now that those don't work with Kate. But..... I think going away with Gina was just a plan he concocted to turn the tables on Kate, and make her want him for herself. Maybe Gina knows what Kate means to him, and knows he will not be able to write, in the city or in the Hamptons,until things are resolved between them. Maybe Gina is helping Rick get Kate back, because she knows that Castle and Beckett, really are Rook and Heat, and that's where his inspiration comes from.
Why would Gina come to the precinct? Castle wanted to make sure Beckett saw them together.
He didn't know that she already broke it off with Deming, and I'm not sure he knew what she was trying to say before Gina arrived. Anyway, yes, it backfired. He could have had her, without the games.
That's just my theory after watching last night. It may change after I view it again. I feel like I spent the whole episode watching Kate's reactions, and didn't really pay that much attention to Castle's.
Oh, and the case.....lame......except for the pen, and Castle's reaction. That was pretty funny. It was even very weakly tied in to the whole Kate and Castle dilemma, which I was disappointed with, because that's one of the things I've been enjoying lately.