Siege definitely need to be better as you say. Part of the problem is that qBot doesn't know how to use siege effectively and often walks it into a melee. I haven't tested siege properly since the attack priorities got implemented so hopefully they work better now than they did before. Increasing the priority is an easy fix to do for now, I will try that. Some special code for handling siege units is definitely necessary, though this might not be easy.
We chatted about this on irc a bit. To briefly summarize, garrisoning is desirable but implementing it without introducing serious exploits is non trivial.
Again this would be good. I'm not sure modelling deer is quite what should be done. It is very important to keep resource gathering going strongly. I played this strategy personally in AoE2 to counter rushes. The principle to keep in mind is always that you need it to cost the enemy more resources than it cost you. In this case the cost to the enemy is the production value of the soldiers whereas you spent the resources making your economy stronger. This means you have to rely on the strength of the buildings which provide a safe zone around your CC so the enemy can't catch up to your workers since they have to take a long way round. Construction of towers provides more safe zone, though garrisoning is also necessary for the safe zones to be properly effective. Also the bot should be producing soldiers while the raid is ongoing which should be possible since the defenders economy will be stronger if they have been playing equally well.
Key buildings: right now you only set Civ Centers to be key buildings (in defence.js). When unassigning defenders, you send them back to the nearest key building (currently only Civ Centers). Maybe you could add fortresses to the list of key buildings?
Patrols: finally, we had a go (but failed) at incorporating patrolling behaviour. Our idea was that we would use the entry points as a patrolling route. A group of soldiers (probably elite soldiers) would walk from one point to the other, guarding the territory. The group could wait a set amount of time at each point (say 10 seconds) and then move on to the next entry point. Eventually qBot will build fortresses on these entry points, at which point the patrol group(s) would simply be walking from fortress to fortress. I think it would be a neat defensive behaviour, as apposed to simply standing still somewhere. Further patrolling points could be Civ Centers and other important buildings.
Training could be improved. The game has not yet been balanced though so any system should be flexible enough to easily handle changes to the template data, so don't bother with lots of manual testing obviously. The templates contain all of the necessary information so you should be able to get this working. I could try and help if you still have problems. It might be necessary to modify the getUnitStrength function a bit.
Adding fortresses to the key buildings list sounds pretty reasonable. If you implement patrols this might become a bit redundant though.
We talked about patrols on irc as well. I think they are fine to do with units that would be idle anyway. I consider it to be low priority but patches are welcome. One thing which I thought of is that the entry points are only around the original base. It would be good to defend expansions as well. The fortress building logic could be improved in this respect as well.