While your pre-flop action isn't completely out of line, protecting your hand is only a truly good reason if you believe the opening bettor will fold quite often. If not, then it's pot-building rather than protection. You could bet more to widen his folding range, but that's on the precarious side with a mid pair OOP.

Did you consider and weigh the reasons for other possible actions, both re-and post-flop? Or did you just find reasons to semi-justify the way you wanted to play the hand in the first place due to reasons like table feel?