Castles & Ruins gives the cost of walls and construction times as:
6" thick wooden palisade 10' tall, 10' wide: 8 days labor, 3 bp
12" thick: 12 days labor, 5 bp
6" thick wooden construction wall 10' tall, 10' wide: 20 days, 8 bp
12" thick: 30 days, 12 bp
6" thick stone wall 10' tall, 10' wide: 68 days, 61 bp
12" thick" 80 days, 72 bp
A Magical Medieval Society suggests a population density of 30-40 adults/acre for a small town. Call that 80-100 people/acre. So that puts a settlement of 850 people around 9.5 acres. When I ask Wolfram-Alpha for the circumference of a circle that size, it gives me 2280'. Let's suppose the village has grown and spills past its walls a bit, so maybe 1500' -- that actually only encloses half the town, 4.1 acres. That means:
A 6" thick wooden palisade took 1200 man-days to build, costing 450 bp (4.5 gold). A 12" one took 1800 days.
A 6" thick wooden construction wall took 3000 man-days, costing 1200 bp (12 gold). A 12" one took 4500 days and 1800 bp.
A 6" thick stone wall took 10,200 man-days, costing 9,150 bp (91 gold).
Even the palisade is a pretty significant investment of time and manpower. People would certainly do it if the village is sufficiently threatened. The stone wall is a huge investment, though, you have to really believe it's going to make a difference to build something like that, and you have to plan it far in advance -- even if the whole town is working on it, it will take months, and then they aren't producing any food, so actually it takes years. You can cut corners to some extent on less sturdy construction but a lot of it is just getting stone to the site. It's not totally out of the question, but it's the value of ~15 decent horses. You could build a 5' wall for half that, but invaders could climb over it pretty easily. Also, you need gates and some kind of supports - could be buildings, towers, buttresses. So these estimates are actually low.
Alternatively, you could have a small fort for people to retreat to. Or, less militaristic, you could have one solid stone structure that the town can retreat into. Historically it would probably be a stone church, not sure for Xa'ar. A religious building is less likely to be seized and used as a base by bandits, I would think. An actual fort does seem like it is asking for trouble.
Another alternative is to have partial walls. You might have a gate and stone walls on the side you expect attacks from, and palisades elsewhere, especially if there is rough terrain. This could also happen if there is (or was) a desire for stone fortifications but it's not finished yet or they gave up on it. Having different areas with different strength defenses is not great tactically, but it does mean you can declare that one section can be
defended by NPCs while there is some smaller area which a smaller flanking force of enemies might come through, that can be held by the PCs.
Narratively, you also might want to start with a smaller less-fortified village that can be dramatically destroyed and the inhabitants flee to a somewhat larger better-defended village.
Depends where you are going with the story.