Triggers attached, but what is the logic behind it? You'll need an in-play refresh rate of at least 0.5 sec.
It won't bet in races of exactly 1 mile, but this can be changed by altering the RaceDistance condition: 1 mile = 1609 m , so you could change one of the triggers to include 1 mile races, by using RaceDistance is equal or greater then 1608, or equal or less than 1610 for the other trigger condition.