I did some research, and it very probably is related to pheromone trails -> chemicals left behind like bread crumbs in the Hansel and Gretel fairy tale. The ink in the pen disrupts the trail. In some unspecified way. However I cannot find an entomological paper on the specific subject at all.
Which raises questions about ant foraging. In a given colony the older ant individuals are foragers, meaning they are likely to die from all kinds of external hazards. It is sort of a calculated risk that normally provides more energy to the colony than is lost through forager mortality. This means any kind of large physical disruption e.g.:
hard rain,
a sandstorm,
a herd of grazing animals clomping through
will destroy the pheromone trails, effectively dooming any foragers out of the hive. So, hmm. Without some kinds mechanisms to prevent foraging in some oncoming bad circumstances sounds like a win, in terms bioenergetics. Can't find anything in the literature on that topic, either, after a short search. Any help out there?