Let's first show that only if direction. Let $N$ be the Nagel point of $\triangle ABC$ and $\omega$ be the incircle of $\triangle ABC.$ Let $\omega$ touch $BC, CA, AB$ at $D, E, F$ respectively.
Suppose that $MI = \frac{r}{3}.$ Then, because it's well-known that $I, M, N$ are collinear in this order with $IM : MN = 1 : 2$, we've $NI = r.$ In other words, $N \in \omega$. Suppose, WLOG, that $N$ is on minor arc $DE.$ It's then clear that $N$ must be the point $F'$ diametrically opposite $F$ on the incircle, because $C, N, F'$ are collinear with $N, F'$ both on minor arc $DE.$ Since $MN' \perp AB$, we then get $MI \perp AB.$
Now, let's show the only if direction. If $MI \perp BC$, say, then we know that:
$$(s-b) = \frac{c \cos \angle B + \frac{a}{2} \cdot 2}{3} \Rightarrow 3a = b+c.$$
Then, we know that the distance from $N$ to $BC$ is $\frac{s-a}{s} \cdot h_a = \frac{a}{s} \cdot h_a = 2 \frac{a}{a+b+c} \cdot h_a,$ which means that $N$ is twice as far from $BC$ as $I$. This easily implies that $N$ is the point $D'$ on the incircle diametrically opposite $D$, because $D'$ is the only point on $AD'$ which is twice as far from $BC$ as $I$ is. Then, we have $IN = r$ and so $IM = \frac{r}{3}.$
$\square$