I used a rather crude method in this experiment and it mostly works, even when the lines take bends and slight curves.
To see it working, left click to drop food and click the button to turn pheromones on and watch their behavior when an ant finds the food.
When an ant finds food it uses pathfinding to head back to the nest. As it travels, it creates a sprite on the layer under it (the red arrow) pointed in the direction it's travelling.
When another ant encounters the red arrow sprite (is overlapping) it turns to face the opposite direction that sprite is pointed in and moves in that direction, constantly checking to see if it is overlapping.
You can download the source at:
Checking sprite collisions or the 'is overlapping' should help solve your other problems.