Can anyone demonstrate a pair of spaces $(X,A)$ such that $\pi_1(A)$ is abelian but $\pi_2(X,A)$ is nonabelian?
I have tried to consider a pair of form $(K(A,2),K(C,1))$ such that (the interesting part of) the homotopy exact sequence becomes $0\to A \to B \to C \to 0$ where $A,C$ are abelian groups but $B$ is nonabelian. I know a map $K(G,n) \to K(H,n)$ must come from a group homomorphism $G \to H$, but I don't know if there are similar results for maps between $K(G,n)$ of different $n$.
I have also noted that it is easy to construct an example if one does not require $\pi_1(A)$ to be abelian, simply take $A$ to be the figure eight and $X=S^3$. But if one tries to abelianize $\pi_1(A)$ by, say, attaching a 2-cell so that it becomes a torus, the original nontrivial commutator $\alpha \beta \alpha^{-1} \beta^{-1}$ acquires a way to become nulhomotopic. I have tried to place obstructions on $S^3$ by punching holes or attaching handles to it, so that the nulhomotopy becomes invalid, but I did not have any success.
Any help would be appreciated!
Here is a way analogous to your use of $K(G,1)$, but going one dimension higher. I will write $K(G,1)$ as $BG$, and call it the classifying space of $G$.
The crucial fact is that the boundary map $\delta: \pi_2(X,A) \to \pi_1(A)$ (for based spaces) has the structure of crossed module. Here a morphism of groups $\mu: M \to P$ is a crossed module if there is also given an operation of the group $P$ on the group $M$, written $(m,p) \mapsto m^p$, satisfying the two rules: for all $p\in P, m,n \in M$
For any such crossed module there is a "classifying space" $B(M \to P)$ containing $B(P)$ as a subspace such that the crossed module
$$\pi_2(B(M\to P),B(P)) \to \pi_1(B(P))$$ is naturally isomorphic as crossed module to $M \to P$. Further, $ \pi_i(B(M \to P)) =0 $ for $i > 2$. These facts may be found in Section 2 of the book partially titled Nonabelian Algebraic Topology (EMS Tracts in Mathematics vol 15, 2011) which I write NAT.
So now all we need to do is produce a crossed module $\mu:M \to P$ with $P$ abelian and $M$ nonabelian.
My colleague Chris Wensley has been working for long on GAP code for crossed modules, and found the following simplest finite example: D8 -> K4 :-
" gap> Display(X4);
Crossed module :-
: Source group has generators:
[ (1,2,3,4), (1,3) ]
: Range group has generators:
[ (5,6), (7,8) ]
: Boundary homomorphism maps source generators to:
[ (5,6), (7,8) ]
: Action homomorphism maps range generators to automorphisms:
(5,6) --> { source gens --> [ (1,2,3,4), (2,4) ] }
(7,8) --> { source gens --> [ (1,4,3,2), (1,3) ] }
These 2 automorphisms generate the group of automorphisms. "
As another possible example, a standard example of a crossed module is the inner automorphism map $\mu: P \to Aut(P)$; so one wants a nonabelian group $P$ whose automorphism group is abelian.
The construction of $B(M \to P)$ in NAT is cubical, since this fits better with the other methods of the book, but the first published construction was simplicial. An exposition of this is in Section 7 of the paper
Brown, R., Groupoids and crossed objects in algebraic topology. Homology Homotopy Appl. 1 (1999) 1–78. pdf.