Nice question! This is a very nontrivial problem involving regular languages.
First of all: no, you cannot run an automaton on every substring of a string skipping other letters, you are supposed to run the automaton only once on the target string.
In this case it is simpler to reason on the complementary of the given language, namely on
$$L^C = \{ w \in (a,b) ^ * \mid \text{ there is a substring } u \text{ of } w \text{ such that } |u|_a−|u|_b>5 \text{ or } |u|_a−|u|_b<-5\}$$
The language $L^C$ is regular, as it is recognized by the following NFA:

(each state name is the difference $|u|_a−|u|_b$, the first letter of the substring $u$ is "found" nondeterministically by the NFA).
So, as $L^C$ is regular, also $L=(L^C)^C$ is.
Following Hendrick's suggestion, I tried to determinize the NFA and to draw its complement, and I get this nice DFA that recognize $L$:

Each name of an accepting state name is an interval: when, running the automaton, we are in state $[x_1,x_2]$ and we have read the string $z$ this means that for all $x\in [x_1,x_2]$ there is a suffix $u$ of $z$ such that $|u|_a−|u|_b=x$. Otherwise said, following Dmitry's suggestion, the automaton calculate the residual set of $z$.
In a sense, as Hendrick says, it is like we are running the automaton on each substring, but this do not mean that we can directly use a DFA that recognize strings such that the difference between the $a$s and the $b$s is in $[-5,5]$ (which would be easy to realize) and run this automaton on each substring of a given one, and in this way prove that the language is regular.
Lastly, I would write a trivial generalization of the result (I think that this is folklore, but I couldn't find a reference).
Let $T$ be a regular language on an alphabet $\Sigma$ and let $L$ be the language defined as follows:
$$L= \{ w \in \Sigma^* \mid \text{ for every substring } u \text{ of } w,\ u\in T\}$$
then also $L$ is regular.
Indeed, as above, consider $L^C$, the complement of $L$, namely
$$L^C = \{ w \in \Sigma^* \mid \text{ there is a substring } u \text{ of } w \text{ such that } u\not\in T\}$$
Then $L^C=\Sigma^*T^C\Sigma^*$, and therefore $L=(\Sigma^*T^C\Sigma^*)^C$ is regular, as the family of regular languages is closed under concatenation and complementation.
Cleary the result is still true for every family of languages closed under concatenation and complementation, but this is not a necessary condition. Indeed, the family of finite languages it is not closed under complementation, but clearly if $T$ is finite, then also $L$ is (as it is always the case that $L\subseteq T$).
On the other hand, this is not true for all classes of languages. Consider the family NR of non-regular languages, then $T=\{1^p\mid p\text{ is prime}\}\in\ $NR, but in this case we have $L=\varnothing$, which is regular.