Given a finite, ergodic Markov $\{X_i\}$, and two natural numbers $a>b$. Let
$$p=P\left[\forall n, \sum_{k=n}^{n+a-1} \mathbf{1}_m(X_k)\leq b\right]$$ where $\mathbf{1}_m(X_k) =1$ if $X_k=m$ and 0 otherwise.
Namely, $p$ is the probability that for any time interval of size $a$, the number of visits to state $m$ is less than or equal to $b$.
The question is the property of $p$ and how to compute it.
Obviously this questions is related to the limited distribution (which, by ergodicity, is equivalent to the stationary distribution), but I could not find the exact link, since stationary distribution talks about the limit, but here, the size of interval is finite. Moreover, I am not sure whether this type of questions has been studied. References would be appreciated. (Note: some imprecision has been corrected, according to an earlier answer.)