I would actually just trigger it. Detect attempt to build townhall, check if there aren't trees too close to it. And in case there are, block the order and use SimError or CS_Error to show an error message
He dont need to. He can just implent the SimError function.
I first suggested using triggers but he wanted it so the pathing got red so you couldnt even place it.
The only thing I could think of was placing invisible mines in the trees to prevent the player from being able to build next to them.