This is an interesting idea. Right now buildings and stockpiles affect where enemies spawn. While I can understand your frustration about crafters dying due to spawning enemies, I (personally) feel like that is just part of the game - you need to protect your Hearthlings if they venture outside of your city.
I do agree patrolling needs work. Right now they patrol farms and stockpiles, and that’s it. You may be interested in @Wiese2007 Patrol Points mod, which expands the patroled items substantially.