Consider a 1-genus torus with two boundary components:
and the paths $a,b,w_1,w_2$ as shown here:
Since you say
Now $i_B(w) = efe^{-1}f^{-1}$
I'll assume you are somewhat comfortable with the fact that the boundary of $B$ (the torus with a single hole) can be expressed as $efe^{-1}f^{-1}$. It is a similar fact that $w_1$ and $w_2$ differ by the commutator $[a,b] = aba^{-1}b^{-1}$. That is, $w_1aba^{-1}b^{-1} = w_2$. I encourage you to draw this all out and convince yourself of this. (I may have drawn the orientations backwards, so you may have to throw in some inverses to make it work.)
Now consider $A$:
Here, I've drawn in some additional curves to help us out. Strictly speaking, these should all be attached to some basepoint as they were in the previous picture, but I didn't want to clutter it. Also for the sake of clutter reduction, I've omitted $a,b,c,d$, where $a,b$ are the paths as in the previous picture around the leftmost hole, and $c,d$ are those around the rightmost.
By applying the first paragraph to the leftmost hole, we know that $w_1aba^{-1}b^{-1} = w_2$. Similarly, for the rightmost hole, we have $w_1 = wcdc^{-1}d{-1}$. Substituting, we get $w_2 = wcdc^{-1}d{-1}aba^{-1}b^{-1}$. But $w_2$ is homotopically trivial, so $w = bab^{-1}a^{-1}dcd^{-1}c^{-1}$.
As before, this depends on exactly what the orientations of everything are, so you might have to throw in some inverses. Accounting for that, (I think) this is what you wanted.
Hope it helps.
I'll also mention that the usual (and easier) way of finding the fundamental group of the $n$-genus torus is by using the $4n$-gon identification, an outline of which can be found here.
Yes, this is a correct application of van Kampen.
A little bit nitpicking:
We see that $U_1$ deformation retracts onto the half sphere with the disk which in turn deformation retracts onto the sphere
The second transformation is not a deformation retraction. You can only deformation retract onto a subset and clearly the sphere is not a subset of half sphere. Your half sphere is simply homeomorphic to the sphere via projection with a base point somewhere inside the half sphere.
Best Answer
I can see that you have the right idea. But your use of the terminology is incorrect.
In the case of a surface $S$ which is the connected sum of two tori with one point removed, you should not say that "the fundamental group would be the wedge sum of 4 circles". A group and a space are different kinds of mathematical objects, and you have to be more careful with your terminology. Instead you should say first that $S$ deformation retracts to the wedge sum of 4 circles. And what follows next is that the fundamental group of $S$ is isomorphic to the fundamental group of a wedge sum of 4 circles (which is isomorphic to a free group of rank 4).
Similarly, when $S$ is the connected sum of two tori with two points removed, you should say first that $S$ deformation restrcts to the wedge sum of 5 cicles, and what follows next is that the fundamental group of $S$ is isomorphic to the fundamental group of a wedge sum of 5 circles (which is isomorphic to a free group of rank 5).