Hi
So long as the price keeps rising, it will cancel and resubmit at the next higher price. If the price falls, the last unmatched bet will get matched.
In version 2 I have added another constant which is the tick difference for the lay bets. You can adjust this if you want to.
Because the trigger relies on counting ticks differences, if there is a gap in the prices, the tick count is not accurate. In version 3 I have included a condition which checks the gap between back and lay prices is 1 tick, otherwise it will not bet / cancel.
If this is not what you want, please describe better how you see the bets getting matched.