what you are missing is the automorphism group of the quadratic form $x^2 - 4 x y + y^2.$ On this site, the relevant observation is usually referred to as Vieta Jumping, which is a special case. The point is that a solution $(x,y)$ to $x^2 - 4 x y + y^2= k$ (in this case $k=-2$) can be replaced by a new solution
$$ (y, 4y - x). $$
CHECK!!!!!!!!
This means that $(a_n, a_{n+1})$ becomes $(a_{n+1}, a_{n+2})$ with the specific
$$ a_{n+2} = 4 a_{n+1} - a_n. $$ Thus, they are all integers.
Furthermore, as long as $a_{n+1} > a_n,$ then $a_{n+2} > a_{n+1},$ so they continue increasing and positive forever by induction.
next day: a short tutorial. Suppose we have positive integers $x,y,q$ and a fixed target $T,$ an integer. Then suppose we have
$$ \color{blue}{ x^2 - q xy + y^2 = T.} $$
Let us take $0 < x < y.$ The increasing direction in Vieta Jumping is
$$ \color{green}{ (x,y) \mapsto (y, qy-x).} $$
The decreasing (with $0 < x < y$) direction is
$$ \color{red}{ (x,y) \mapsto ( qx-y, x).} $$
To be specific, the thing keeps decreasing the sum of the entries as long as $qx < 2y.$ The way proofs are arrived at in these problems is to examine those solutions with $x \leq y$ but $qx \geq 2y.$ These are what Hurwitz, in 1907, called Grundlösungen, or fundamental solutions. If there are no fundamental solutions, there are no solutions at all, because positive integers cannot decrease forever. If the fundamental solution has one of the variables $x,y$ equal to zero, that says that the target $T$ is a square. And so on. By and large, the jumping phenomenon stays the same, it is the inequalities towards the end that vary.
You've made a good start, but note that, as explained below, the factors of $2022 - 1 = 43(47)$ don't apply. To finish, first define
$$\alpha(n,m)=|\{1\le k\le n-1 : (k,m)=1\}| \tag{1}\label{eq1A}$$
This then gives
$$\begin{equation}\begin{aligned}
\phi(n,m) & = |\{1\le k\le m : (k,m)=1\}| - |\{1\le k\le n-1 : (k,m)=1\}| \\
& = \phi(1,m) - \alpha(n,m)
\end{aligned}\end{equation}\tag{2}\label{eq2A}$$
Since $\phi(1,m)=\phi(m)$, as you've noted, then using \eqref{eq2A}, the first problem condition becomes
$$\begin{equation}\begin{aligned}
\frac{\phi(m) - \alpha(n,m)}{m-n} & \ge \frac{\phi(m)}{m} \\
m(\phi(m) - \alpha(n,m)) & \ge (m - n)(\phi(m)) \\
-m\alpha(n,m) & \ge -n\phi(m) \\
\frac{\alpha(n,m)}{n} & \le \frac{\phi(m)}{m}
\end{aligned}\end{equation}\tag{3}\label{eq3A}$$
Let $p_1$ be the smallest prime factor of $m$. If $m$ has at least $2$ distinct prime factors then, with $n = p_1$, the left side of \eqref{eq3A} becomes $\frac{p_1-1}{p_1} = 1 - \frac{1}{p_1}$. However, using Euler's product formula, the right side of \eqref{eq3A} becomes $\prod_{p\mid m}\left(1 - \frac{1}{p}\right) \lt 1 - \frac{1}{p_1}$, contradicting the inequality in \eqref{eq3A}.
Thus, $m$ can have only one distinct prime factor, so for some integer $a \ge 1$,
$$m = p_1^a \tag{4}\label{eq4A}$$
The RHS of \eqref{eq3A} is thus $1 - \frac{1}{p_1}$. For the LHS, consider $n \gt 0$ with $n = sp_1 + t$, $0 \le s \lt p_1^{a-1}$ and $0 \le t \lt p_1$. With $t = 0$, then $s \ge 1$ with there being $s-1$ multiples of $p_1$ less than $n$, which means $\frac{\alpha(n,m)}{n} = \frac{(n - 1) - (s - 1)}{n} = \frac{n-s}{n} = 1 - \frac{s}{sp_1} = 1 - \frac{1}{p_1}$, so \eqref{eq3A} holds. Alternatively, with $1 \le t \le p_1 - 1$, then $\frac{\alpha(n,m)}{n} = \frac{(n - 1) - s}{n} = 1 - \frac{s + 1}{sp_1 + t} \lt 1 - \frac{s + 1}{sp_1 + p_1} = 1 - \frac{s+1}{(s+1)p_1} = 1 - \frac{1}{p_1}$, so \eqref{eq3A} also holds in this case.
This means all $a \ge 1$ satisfy \eqref{eq4A}. Next, the second required condition is
$$m^2 \mid 2022^m + 1 \; \to \; m^2 \mid 2022^{2m}-1 \tag{5}\label{eq5A}$$
Thus, the multiplicative order of $2022$ modulo $p_1$ must divide $2m$, i.e.,
$$(r = \operatorname{ord}_{p_1}(2022)) \mid 2p_1^{a} \tag{6}\label{eq6A}$$
However, as you've already indicated, since $2022^{p_1-1}\equiv 1\pmod{p_1}$, then $r \mid p_1 - 1$. Thus, as you've already stated, from \eqref{eq6A} we have $r \mid (\gcd(2p_1^{a},p-1) = 2)$, i.e., $r$ must be $1$ or $2$. It can't be $1$ since then $p_1 \mid 2022^{m} - 1$, contradicting the LHS of \eqref{eq5A}, so it must be $2$. This means
$$p_1 \mid (2022 - 1)(2022 + 1) \tag{7}\label{eq7A}$$
We can't have $p_1 \mid 2022 - 1$ since then $r = 1$, which has already been discarded, so $p_1 \mid 2022 + 1$. Next, the Lifting-the-exponent lemma, \eqref{eq4A} and the LHS of \eqref{eq5A} gives
$$\begin{equation}\begin{aligned}
\nu_{p_1}(2022^{m}+1) & = \nu_{p_1}(2022 + 1) + \nu_{p_1}(m) \\
& = \nu_{p_1}(2022 + 1) + a \\
& \ge 2a
\end{aligned}\end{equation}\tag{8}\label{eq8A}$$
This means $\nu_{p_1}(2022 + 1) \ge a$. Since $2022 + 1 = 7(17^2)$, we have either $p_1 = 7$, which gives $m = 7$, or $p_1 = 17$, which gives $m = 17$ or $m = 17^2 = 289$. Thus,
$$m \in \{7, 17, 289\} \tag{9}\label{eq9A}$$
are the only values of $m \ge 2$ which satisfy both of the problem conditions.
Best Answer
At the start of the solution, you have that
$$(a_{n+1})^2 - 1 \leq (1 - a_n) \,(a_{n+2} - 1). \tag1 $$
The analysis then shows that if $~a_{n+1}~$ and $~a_{n+2}~$ are both greater than $~1,~$ that
$$0 < 1 - a_n < 1 < 1 + a_{n+2}. \tag2 $$
Continuing to assume that $~a_{n+1}~$ and $~a_{n+2}~$ are both $~> 1,~$ the analysis then uses (2) above to show that
$$(a_{n+1})^2 - 1 < a_{n+2}^2 - 1. \tag3 $$
The inequality in (1) above holds for any $~n \in \Bbb{Z^+}.~$
Note that if $~n \in \Bbb{Z^+},~$ then so is $~n+1.~$
This implies that the inequality expressed in (1) above, must also be true if $~n~$ is replaced by $~n+1.$
Making such a replacement gives the inequality:
$$(a_{n+2})^2 - 1 \leq (1 - a_{n+1}) \,(a_{n+3} - 1). \tag4 $$
By multiplying each of the RHS factors in (4) above by $~-1,~$ this implies that
$$(a_{n+2})^2 - 1 \leq (1 - a_{n+3}) \,(a_{n+1} - 1). \tag5 $$
Now, continuing to assume that $~a_{n+1}~$ and $~a_{n+2}~$ are both $~> 1, ~$ things get a little tricky. Since the LHS in (5) above is positive, so is the RHS.
Then, since the 2nd factor in (5) above is positive, so is the 1st factor in (5) above. Therefore, since you are given that each element in the sequence is positive, you have that $~0 < a_{n+3} < 1 < a_{n+1}.$
Therefore,
$$1 - a_{n+3} < 1 + a_{n+1}.$$
So, using (5) above, you have that
$$(a_{n+2})^2 - 1 < (1 + a_{n+1}) \,(a_{n+1} - 1) = (a_{n+1})^2 - 1. \tag6 $$
Therefore, the assumption that $~a_{n+1}~$ and $~a_{n+2}~$ are both $~> 1~$ has led to the two conclusions represented by (3) above and (6) above. Since these conclusions contradict each other, you now know that (except for possibly $~a_1,~$ and $~a_2~$) the sequence can't have two consecutive terms both $~> 1.$