Some thoughts:

capturing the two stones is fine.
At

you may want to play on the star point instead, since it has a better relationship to the upper right. The idea is fine though.

is fine and

could be either of your move and P18. Not sure I like O15 as much.
At

the idea behind your move is fine, but when white contacts your stone, it's usually urgent. If you don't want to give white the local advantage there, you need to make sure you have a followup for your move or white will just get free forcing moves as in the game. Black is strong enough there that you could consider just R14, looking to give white no momentum at all. Ideally, you'll be able to threaten one of the side groups with the three stones later in such a way as to be able to make a move that's sente against both sides.
By

white's group is pretty strong, which means black's three stones have been weakened. If you can get A or something like it to work, that would be ideal. One spot to the right of it has potential, at least (N18). The game move turned out okay, but maybe just turning at P10 was good too.
At :b51, black needs to play one line higher at S6 and then should be connected enough.

doesn't work, so don't play it. Just T9 is fine. white is sealed in and small, and you have sente moves against the group.
For the later fight:
At

not playing Q19 is asking for trouble, and your stones look okay if you play it.
At 139, just net white with F7.
At 155, drop to the second line and white's dead as a doornail.
At 163 again, atari at L1 and white is cut and dead.
At 217, take L19 to prevent ko, and you can at least get seki.
The moral is not to blindly follow your opponent around. there are quite a few points where the right move would cause white to collapse, if you look away from where white just played to where the weaknesses are.