You are actually asking two questions, both rather complicated.
- Is there a chemical that induces avoidance in ants (or at least some ant species)?
- Can you teach ants to avoid an odor.
After a quick glance at the literature, I'd say that there are some chemicals that induce avoidance.
But I was frankly too lazy to look into the learning aspect.
It kinda rubs me the wrong way, because bats are not actually blind. They have pretty decent eyesight.