Solution (source code)

= Solution

A random time $\tau$ is a <stopping time> for the <natural filtration> $(\mathcal F_n)$ of a <Markov chain> when $\{\tau\le n\}\in\mathcal F_n$ for every $n$. The <Strong Markov property> says that, conditionally on $\tau<\infty$ and $X_\tau=i$, the process after $\tau$ is a fresh copy of the chain started from $i$, independent of the pre-$\tau$ history.

Before capture define the half-separation
$$
D_n=\frac{Z_n-Y_n}{2}.
$$
For $D_n=k\ge2$, independence of the two moves gives the <transition probabilities>
$$
\mathbb P(D_{n+1}=k-1\mid D_n=k)=\frac q2,
$$
$$
\mathbb P(D_{n+1}=k\mid D_n=k)=\frac12,
\qquad
\mathbb P(D_{n+1}=k+1\mid D_n=k)=\frac{1-q}{2}.
$$
Ignore the holding steps. The resulting embedded chain is a <biased random walk> that moves left with probability $q$ and right with probability $1-q$. Its expected number of moves needed to descend one level is $1/(2q-1)$; this follows either from <first-step analysis> or from its drift $1-2q$. A non-holding move occurs with probability $1/2$ at each time, so its mean waiting time is two. Hence, for every $m\ge2$, the expected time to go from separation $2m$ to $2(m-1)$ is
$$
\boxed{\mu=\frac2{2q-1}}.
$$