As Darij suggests, we may count separately the sum of legs and the sum of arms. Denote the rows sizes $t_1,t_1+t_2,\dots,t_1+\dots+t_a$, where $t_i,1\leqslant i\leqslant a+1$, are non-negative integers and $\sum_{i=1}^{a+1} t_i=b$. Then the sum of arms (let's think that the arm includes the half of the source of the hook and the leg another half) equals $\sum_{i=1}^a \frac12(t_1+\dots+t_i)^2$. By symmetry, we know that the sums of $t_i^2$, $t_it_j$ over all diagrams do not depend on $i$, or respectively on a pair $i<j$. From $\sum t_i=b$ we see that the sum of $t_i$ (with fixed $i$) equals $\binom{a+b}b\cdot \frac{b}{a+1}$. Next, since $t_1^2+t_1t_2+\dots+t_1t_{a+1}=t_1b$, we see that $X+aY=\binom{a+b}b\cdot \frac{b}{a+1}$, where $X=\sum t_1^2$, $Y=\sum t_1t_2$. For finding $X$ we may observe that it is a coefficient of $x^b$ in $(\sum_{i=0}^\infty i^2x^i)(\sum_{i=0}^\infty x^i)^a$. We have $\sum_{i=0}^\infty i^2x^i=(x+x^2)(1-x)^{-3}$, so $X=[x^b](x+x^2)(1-x)^{-a-3}=\binom{a+b+1}{a+2}+\binom{a+b}{a+2}$. Rest is straightforward.