Doesn't that open up another side of your territory though?
I keep getting gangbanged from every end.
Generally speaking, you want to expand in the direction that'll make that side safer faster. Say you're kinda close to the sea, or some mountains or whatever, expand there first, so you can then go the other way and be "safe" on that side. If you can't be safe, it's good to expand until some sort of chokepoint like area, where you can park a low tier army(tier 1 units+1lord, no fancy shit) that can rotate between the various settlements in one forced march turn max, and wall those settlements. Fighting defensive fights within walls is easy even against high tier armies if you have a low tier army+garrison. You do need the walls though otherwise you'll get murdered, since the AI sucks at sieges. Still won't prevent you from getting fucked if you fight several armies, but you can retreat out if you see a bunch coming and buy time with just the garrison fighting.
This is how you defend the corners of your empire basically, some dummy shit armies and walled settlements. In general, you'll want to wall near everything in the game for safety, but especially the edges of your empire(and since it'll expand, eventually everything is walled anyway).
As for autoresolve in midgame, if you're losing autoresolves, your units aren't good enough. You need to upgrade these shit tier1 units into tier 4 or tier5 units and then you can autoresolve full stacks with minimal losses. The only tier 1-2 units you want to keep lategame are some ranged units and some artillery, but all your frontline infantry needs to be as strong as possible since in autoresolve, they take all the damage and if they're not strong enough, the damage will spill over to your other stuff and do way more damage. Also having the lord red skill tree for army buffs, especially for your infantry, is a must for easy autoresolves. Or manual fights really, the red line is just very good and you should focus on that once you have lightning strike in blue/upkeep reduction if there's some.