Well that all depends on your map. I suggest making the guards able to quickly dispatch any threat, but don't go overboard. For instance, if your "town" is just the starting area of your heroes where they are killing level 1 spiders, then having a level 50 guard that does 200 damage probably isn't necessary. However, if you're making a huge city then you might want to have much more powerful guards to protect you from large threats.
Remember, it all depends on your map. Also, think of a real life situation. Back in the middle ages, the huge castles owned by feudal lords had the highly trained knights and mercenaries to protect the kings/lords. The country villages probably just had a peoples militia. In comparison, the trained castle's guards could easy defeat the inexperienced peasants.
As for making units attack the town, you'll need to use triggers for that. The trigger is fairly simple:
This is the first trigger, which sets up the timer. You'll need to create a "timer" variable to store the timer in.
-
Init
-
Events
-
Time - Elapsed game time is 1.00 seconds
-
Conditions
-
Actions
-
Countdown Timer - Start AttackTimer as a (One-shot OR Repeating) timer that will expire in 300.00 seconds
This is the second trigger:
-
Spawn
-
Events
-
Time - AttackTimer expires
-
Conditions
-
Actions
-
Unit - Create 1 Footman for Neutral Hostile at (Center of (Spawn <gen>)) facing Default building facing degrees
-
Unit - Order (Last created unit) to Attack-Move To (Center of Town <gen>)
Now, be warned, I think this leaks... you can get another user here to clean it up a bit, but this will do basically what you want (I hope)!