Firstly $\frac{\phi-1}{n} \in \operatorname{End}_{\mathbb{F}_q}(E)$ is equivalent to $\mathbb{Z}[\frac{\phi-1}{n}] \subset \operatorname{End}_{\mathbb{F}_q}(E)$ because $\operatorname{End}_{\mathbb{F}_q}(E)$ is a ring.
For a quadratic integer $\alpha$, the norm $N(\alpha) = \alpha\bar{\alpha}$ and trace $T(\alpha) = \alpha+\bar{\alpha}$ appear as coefficients in the minimum polynomial of $\alpha$: $(x-\alpha)(x-\bar{\alpha}) = x^2-T(\alpha)x + N(\alpha)$. The discriminant of this polynomial is $T(\alpha)^2 - 4N(\alpha)$.
The discriminant of the quadratic order $\mathbb{Z}[\frac{\phi-1}{n}]$ is the discriminant of the minimal polynomial of $\frac{\phi-1}{n}$, as calculated in $\color{red}{\mathbf{2}}$ using the above.
Note that there is a typo in $\color{blue}{\mathbf{1}}$: the denominator of the norm should be $n^2$, as in the $\color{blue}{\text{blue}}$ box.
In the $\color{red}{\text{red}}$ box, $\mathcal{O}\Big(\frac{t^2-4q}{n^2}\Big)$ denotes the complex quadratic order of discriminant $\frac{t^2-4q}{n^2}$, namely $\mathbb{Z}[\frac{\phi-1}{n}]$.