Projection onto imaginary time to obtain time-ordered correlator

To compute the vacuum expectation value

$$\langle \Omega | T\{q(t_{1})\cdots q(t_{n})\}|\Omega\rangle$$

in the path integral formalism, we start with the time-ordered product in the path integral representation

$$\langle q_{f},t_{f}|\ T\{q(t_{1})\cdots q(t_{n})\}\ |q_{i},t_{i}\rangle=\int\ \mathcal{D}\phi\ e^{iS}\ q(t_{1})\cdots q(t_{n}),$$

use the fact that

$$|\psi\rangle = \int\ dq_{i}\ |q_{i},t_{i}\rangle\ \langle q_{i},t_{i}|\psi\rangle$$

and the projection trick

$$\lim\limits_{T \to\infty}e^{-iHT(1-i\epsilon)}|\Omega\rangle = \sum\limits_{n}e^{-iE_{n}T(1-i\epsilon)}|n\rangle\langle n|\Omega\rangle$$

to project out all the states with $n \neq 0$ and obtain

$$\langle \Omega | T\{q(t_{1})\cdots q(t_{n})\}|\Omega\rangle = \frac{\int\mathcal{D}q(t)\ e^{iS[q]}q(t_{1})\cdots q(t_{n})}{\int \mathcal{D}q(t)\ e^{iS[q]}}.$$

How can we be sure that the projection trick is a legitimate step in the calculation and not some sleight of hand? Is the projection trick performed in the limit that $\epsilon \rightarrow 0$?

How is the expansion of $|\psi\rangle$ used in the time-ordered product to obtain the vacuum expectation value?

If I understand the projection trick that you show here, it seems that all that is required is first to assume that we have a complete basis $|n\rangle$ given by the eigenstates of the Hamiltonian. (This seems to be a fairly innoxious assumption.) One can then form the identity operator $$1 = \sum_n |n\rangle \langle n|$$ and insert it between the exponent that contains the Hamiltonian and the state $|\psi\rangle$. When the exponent with the Hamiltonian operates on these eigenstates one get $E_n$ as the eigenvalues and whala there you are. I'm not sure of the limit $T\rightarrow\infty$ plays any role here.