Hi Larp,
It includes only matched bets.
The expression back_payout is greater than lay_payout does not tell you whether you are in profit, it only tells you that you placed more back "money" on that selection than you did lay. It indicates that there is a potential for a hedge, either green-up or loss distribution.