The recording of the data is no problem and I have managed to get that working.
I have also had a play with the plugins and can add 1 to a variable during each call and that sort of thing.
The problem is there seems to be no way to decide whether to play a OGM or record to Mailbox based on the condition of a variable