is there a Dwarf civ by any chance?
Nah. There's a few dwarves recruitable in some of the norse-et-al influenced nations (Niefal, etc., I think.), but no non-mod pure dwarf civs. There were a couple mod nations for D3, but no clue about for D4.
Question: is there some kind of magical mathematical formula to use when determining the # of units to Storm Castle?
The short answer is "no", iirc. The big thing with storming castles is precisely the bottleneck you've noticed allowing a small force of the right sort of critter to hold off much, much more than they should be able to.
There's a few things you can do. The big one is magic and flyers, which can bypass the natural bottleneck and wreck all sorts of havoc. Tramplers can also help with the gate area, providing there's nothing larger than them holding said gate. An elite core force (capable of going toe-to-toe -- and then some, because you've got tower arrows and whatever else the enemy has for ranged options -- with whatever is plugging the gap) can break into the stopgap and let loose the dogs of chaff. Iirc, you might be able to do some things with placement (put all your crap way back, so the stuff inside the garrison will come out and face you, allowing you to surround and dogpile a
lot easier). Basically, the issue of castle breaking usually has a lot more to do with
quality (and composition) than it does with quantity. If they're not up to snuff, all the units in the world isn't going to break through a wall of high HP, high defense/etc regening troops before the turn limit hits, and more chaff is often just more chances for the tower attacks or w/e to trigger moral checks (and eventually failures, resulting in routing).
Re: The J. Wall, insofar as I'm aware the only thing up with that is it's a free castle. You can check in-battle in the upper right (usually, anyway) for a little pentagram thing that'll tell you if there's any persistent battlefield-wide spells going. Least that was how it was in D3... fairly sure it still is in D4. Think I've seen it (few pretenders have it natural, nowadays), even...