For heads up positions are really easy - SB is always position 9 and BB is 8. So in and out of position can be done just by checking for the appropriate position.
holdem_hand_player_statistics.position=8
...means the player is in the big blind.
To see if the BB faces an open-raise you can check for facing a steal:
holdem_hand_player_statistics.flg_blind_def_opp
..and if they call this then their actions string will be exactly "C".
lookup_actions_p.action = 'C'
To see if you both check the flop you can again use the actions string:
lookup_actions_p.action = 'X'
..says that the only thing the player did on the flop was check, so the SB must have checked too.
So far, both your columns (the actions and the opportunities) will need all of the checks.
The difference comes for seeing if the BB bets the turn.
holdem_hand_player_statistics.flg_f_bet
Have a look at the
Custom Statistics and Reports FAQ and have a go at putting your stat together - if you get stuck please post back and tell us where you're up to.
NOTE: If you ONLY play heads up then columns built like this will be fine, but they won't behave correctly at other table sizes.