13 If the function $f(x)=4 \sin x \cdot \sin ^{2}\left(\frac{\pi}{4}+\frac{x}{2}\right)+\cos 2 x$.
(1) Let $\omega>0$, and be a constant. If the function $y=f(\omega x)$ is increasing in the interval $\left[-\frac{\pi}{2}, \frac{2 \pi}{3}\right]$, find the range of $\omega$;
(2) Let the set $A=\left\{x \left\lvert\, \frac{\pi}{6} \leqslant x \leqslant \frac{2 \pi}{3}\right.\right\}, B=\{x|| f(x)-m |< 2\}$, if $A \cup B=B$, find the range of the real number $m$.
13
$$
\text { (1) } \begin{aligned}
f(x) & =4 \sin x \cdot \frac{1-\cos \left(\frac{\pi}{2}+x\right)}{2}+\cos 2 x \\
& =2 \sin x(1+\sin x)+\cos 2 x \\
& =2 \sin x+1 .
\end{aligned}
$$

Since $f(\omega x)=2 \sin \omega x+1$ is an increasing function on $\left[-\frac{\pi}{2}, \frac{2 \pi}{3}\right]$, we have
$$
\left[-\frac{\pi}{2}, \frac{2 \pi}{3}\right] \subseteq\left[-\frac{\pi}{2 \omega}, \frac{\pi}{2 \omega}\right]
$$

Thus, $\frac{2 \pi}{3} \leqslant \frac{\pi}{2 \omega}$, solving for $\omega$ gives $\omega \in\left(0, \frac{3}{4}\right]$.
（2）From $|f(x)-m|<2$ we have
$$
f(x)-2<m<f(x)+2 \text {. }
$$

Since $A \cup B=B$, it follows that $A \subseteq B$, meaning that when $\frac{\pi}{6} \leqslant x \leqslant \frac{2 \pi}{3}$, the inequality
$$
f(x)-2<m<f(x)+2
$$

always holds, so
$$
[f(x)-2]_{\max }<m<[f(x)+2]_{\min } .
$$

Therefore,
$$
\begin{array}{l}
f(x)_{\min }=f\left(\frac{\pi}{6}\right)=2, \\
f(x)_{\max }=f\left(\frac{\pi}{2}\right)=3
\end{array}
$$

Hence, $m \in(1,4)$.