Let $\epsilon$ be a fundamental unit, and let $\eta = \pm \epsilon^k$ be any other unit. Your question is how to tell if $\eta = \pm \epsilon$, or whether $k = \pm 1$. You already have the key idea: if $\eta = a + b \sqrt{m}$, then the size if $\eta$ is related to the size of $b$. Hence the smallest $b$ can only occur for $k = \pm 1$.
Let $\epsilon = r + s \sqrt{m}$, and $\eta = a + b \sqrt{m}$. Without loss of generality, we may assume that $r,s \ge 1$ and $a,b \ge 1$. Thus if $\eta = \pm \epsilon^k$, then $\eta = \epsilon^k$ for $k \ge 1$.
Lemma: $s$ is the closest integer to $\displaystyle{\frac{\epsilon}{2 \sqrt{m}}}$ and $b$ is the closest integer to $\displaystyle{\frac{\eta}{2 \sqrt{m}} = \frac{\epsilon^k}{2 \sqrt{m}}}$.
In particular, if $m > 1$, then $b > s$. Since $ms^2 \pm 1 = r^2 $ and $m b^2 \pm 1 = a^2$, this answers your question.
Proof: The argument for both is the same, so let's just do
$\eta = a + b \sqrt{m}$. We have $\eta > \sqrt{m}$. The conjugate of $\eta$ is is $\sigma \eta = a - b \sqrt{m}$. The assumption that $\eta$ is a unit implies that $N(\eta):=\eta \cdot (\sigma \eta) = a^2 - m b^2 = \pm 1$. This means that the conjugate $\sigma \eta$ is very small, less than $1/\sqrt{m}$. It follows that:
$$b = \frac{1}{2 \sqrt{m}} \left(\eta + \sigma \eta\right) = \frac{1}{2 \sqrt{m}} \left(\eta + \frac{N(\eta)}{\eta}\right).$$
In particular,
$$\left| b - \frac{1}{2 \sqrt{m}} \eta \right| \le \frac{1}{2 \sqrt{m} |\eta|} \le \frac{1}{2m} < \frac{1}{2},$$
and so $b$ is the closest integer to $\displaystyle{\frac{\eta}{2 \sqrt{m}}}$, as claimed.