Thanks gmaxwell. Is there anywhere a script could pull the special P2P hashchain commitment from if and when it changes (in order to do a regex search of the coinbase)? Or is that something you'd have to run a p2Pool node in order to do?
The will always be different and depends entirely on P2Pool's sharechain, so I don't think it's too useful. Instead, the second to last txout will always be to the donation address (1Kz5QaUPDtKrj5SqW5tFkn7WZh8LmQaQi4) and then you can match the template of the last txout (0 value to OP_RETURN PUSH ). Either of those alone is probably good enough, but combined should work very well.
Thanks forrestv. I didn't think of looking for the donation address to confirm.