1. You don't need custom stats for these - you can use the built-in stat "Fold to Steal" and set the Position property in the Hud Editor to either BB or SB.
2. Take a look at how the "WTSD" (Went To ShowDown) stat is made and you can make a new version of a steal defense stat which includes that information.
The
Custom Statistics Guide will get you started. The
Tutorial: Custom Reports and Statistics was written for PT3 but the same principals apply and this goes into much more detail.
For example, a column to count how often you face a steal and go to showdown would be:
sum(if[cash_hand_player_statistics.flg_showdown AND cash_hand_player_statistics.flg_blind_def_opp, 1, 0])
I'm not sure exactly how you'd like to define the "opportunities" column, but I guess it might be times that the player faced a steal and didn't fold immediately? That could be:
sum(if[cash_hand_player_statistics.flg_blind_def_opp AND lookup_actions_p.action != 'F', 1, 0])