We also faced this when Treeleaf Japan ... a completely wooden building (built without nails, just joined wood beams) ... was infested with termites ...
A Google search on the subject, and talking to some other Buddhist clergy in various traditions, turned up the fact that (as I suspected), infested wooden Buddhist temples will take countermeasures ... though sometimes followed by a memorial service or the like for the little lives taken (and although some claim not too, and that good chanting is enough to chase the bugs away ... I tried that, no luck.) ...
The following was also typical advice, and I gave it a try ...
In the area of prohibitions against killing, one laywoman asked, "What should we do if there are mice and termites at home?" Dharma Master Heng Lyu answered, "You first post a notice asking them to leave. Next, you use insect repellants to chase them out. Avoid insecticides because you want to avoid the karma of killing."
One layman asked, "How do you avoid harming living beings while mowing the lawn?"
Dharma Master Heng Lyu said, "You would first post a notice to let the small creatures know that it's best to move, then mow the lawn. While you're mowing the lawn, recite the Great Compassion Mantra at the same time."
Excerpted from the article, "The City of Ten Thousand Buddhas Holds First Transmission of the Lay Bodhisattva Precepts in the New Millenium", on page 49 of the October 2000 issue (volume 31, series 73) of the Vajra Bodhi Sea.
And, of course, this is the famous "Dalai Lama kills the Mosquito" video ...
I really feel the weight of having to kill those termites ... but somehow, whenever there is an earthquake and the heavy roof timbers start shaking over my family's heads ... I know it was necessary. That is the Koan.
PS - What if a wasp came in the house and threatened to bite my daughter? (Assuming that I could not just open a window and let it free) I would kill the wasp in a second, with anything I could grab, because allergic people might be around. I would Gassho to it after.
PPS - When I was in India a year or so ago, I encountered the Jains. The Jains, a sect parallel in teachings to Buddhism and from the same time, will wear face masks to avoid inhaling an insect ...
The Buddha's way was more one of moderation on this issue. The Jains, alas, will still kill many creatures just by moving, walking and eating vegetables in daily life.
Gassho, Jundo