  A code $C$ in the Hamming graph $\varGamma=H(m,q)$ is
$2\it{\text{-neighbour-transitive}}$ if ${\rm Aut}(C)$ acts transitively on
each of $C=C_0$, $C_1$ and $C_2$, the first three parts of the distance
partition of $V\varGamma$ with respect to $C$. Previous classifications of
families of $2$-neighbour-transitive codes leave only those with an affine
action on the alphabet to be investigated. Here, $2$-neighbour-transitive codes
with minimum distance at least $5$ and that contain "small" subcodes as blocks
of imprimitivity are classified. When considering codes with minimum distance
at least $5$, completely transitive codes are a proper subclass of
$2$-neighbour-transitive codes. Thus, as a corollary of the main result,
completely transitive codes satisfying the above conditions are also
classified.
