For any $n\times n$ matrix $A$ we can find an eigenvalue $\lambda$ (although we may have to use complex numbers). Then there is an eigenspace $E_\lambda$ of vectors of dimension $0<m\leq n$ corresponding to $\lambda$. Choose a basis $\mathcal{B}=\{\textbf{x}_1,\dotsc,\textbf{x}_m\}$ for this eigenspace, and consider how the matrix $B$ acts on those basis vectors, which gives you a new representation $B'$ of (the restriction of ) $B$ relative to this basis.
$$B'=B|_{E_\lambda}=\begin{pmatrix}
B\textbf{x}_1 & \dotsc & B\textbf{x}_m
\end{pmatrix}$$
A priori, since there are $m$ vectors with $n$ components making up the columns of this matrix, it would appear to be an $n\times m$ matrix, which need not be square. However, as you have already observed in your question, we know that
$$
A(B\textbf{x}_i) = AB\textbf{x}_i = BA \textbf{x}_i = B(A\textbf{x}_i)\\
=B(\lambda \textbf{x}_i) = \lambda(B\textbf{x}_i)
$$
so $B\textbf{x}_i$ is also an eigenvector of $A$ with eigenvalue $\lambda$ or else is $0$. Or in other words $B$ takes eigenvectors of $A$ to new eigenvectors of $A$ with same eigenvalue or at worst to members of that eigenspace (the zero vector is in the eigenspace but is not considered an eigenvector). This is where the commutativity of $A$ and $B$ is invoked.
Hence each $B\textbf{x}_i$ is a linear combination of the eigenbasis vectors $\{\textbf{x}_j\}_j$, and may be therefore expressed as an $m$-component vector in terms of the basis $\mathcal{B}$, so this new matrix is actually square $m\times m$ when the column vectors are expressed in terms of that basis.
Therefore $B'$ has an eigenvalue $\mu$ (possibly complex) and also an eigenvector $\textbf{y}$. That is $B'\textbf{y}=\mu\textbf{y}$. This eigenvector of $B'$ (by construction) is also an eigenvector of $B$ (since $B'$ is a restriction of $B$) and of $A$, since
$$\textbf{y}=\sum a_i\textbf{x}_i\Rightarrow \\
\quad A\textbf{y}=A(\sum a_i\textbf{x}_i)=\sum a_iA\textbf{x}_i=\\
\sum a_i\lambda\textbf{x}_i=\lambda(\sum a_i\textbf{x}_i)=\lambda\textbf{y}.$$
Therefore $\textbf{y}$ is an eigenvector of both $A$ and $B$.