  We study a Markov chain on $\mathbb{R}_+ \times S$, where $\mathbb{R}_+$ is
the non-negative real numbers and $S$ is a finite set, in which when the
$\mathbb{R}_+$-coordinate is large, the $S$-coordinate of the process is
approximately Markov with stationary distribution $\pi_i$ on $S$. If $\mu_i(x)$
is the mean drift of the $\mathbb{R}_+$-coordinate of the process at $(x,i) \in
\mathbb{R}_+ \times S$, we study the case where $\sum_{i} \pi_i \mu_i (x) \to
0$, which is the critical regime for the recurrence-transience phase
transition. If $\mu_i(x) \to 0$ for all $i$, it is natural to study the
Lamperti case where $\mu_i(x) = O(1/x)$; in that case the recurrence
classification is known, but we prove new results on existence and
non-existence of moments of return times. If $\mu_i (x) \to d_i$ for $d_i \neq
0$ for at least some $i$, then it is natural to study the generalized Lamperti
case where $\mu_i (x) = d_i + O (1/x)$. By exploiting a transformation which
maps the generalized Lamperti case to the Lamperti case, we obtain a recurrence
classification and existence of moments results for the former. The generalized
Lamperti case is seen to be more subtle, as the recurrence classification
depends on correlation terms between the two coordinates of the process.
