May I suggest the attached trigger file. Edit the market type, status etc. as needed.
I tested it on Greyhound (no ongoing horse races at the moment) by changing the price_val from 2.0 to 5.0.
The first runner hits the 5.0 mark at about 2-3 mins before the off, then follows the second one which gets backed.