Assume that $N$ is prime. Then we prove $S_{n-2}\equiv \pmod N$$S_{n-2}\equiv 0\pmod N$, the assumption that $8k<3^n$ is not used. I do not know how to prove it in the opposite direction.
We have $P_m(2\cos t)=2\cos mt$, so they are Chebyshev polynomials and satisfy $P_{mn}=P_n\circ P_m$. Note that $x^3-3x=P_3$, thus $S_{i}=P_{18k\cdot 3^i}(3)$, $S_{n-2}=P_{2k\cdot 3^n}(3)=P_{(N+1)/4}(3)=P_{(N+1)/2}(\sqrt{5})$.
We prove that $2^{3(N+1)/2}P_{(N+1)/2}(\sqrt{5})$ is divisible by $N$ in the ring $\mathbb{Z}[\sqrt{5}]$. This would imply $$\frac{2^{3(N+1)/2}P_{(N+1)/2}(\sqrt{5})}N\in \mathbb{Z}[\sqrt{5}]\cap \mathbb{Q}=\mathbb{Z},$$ thus $N$ indeed divides $P_{(N+1)/2}(\sqrt{5})$. Further we write congruences modulo $N$ in the ring $\mathbb{Z}[\sqrt{5}]$.
Using quadratic reciprocity and the explicit calculations of powers of 3 modulo 4, we see that your additional condition means that 5 is a quadratic non-residue modulo $N$. This means that $5^{(N-1)/2}\equiv -1$, or $5^{N/2}\equiv-\sqrt{5}$. We have $$ 2^{3(N+1)/2}P_{(N+1)/2}(\sqrt{5})=2^{N+1}\left(\left(\sqrt{5}+1\right)^{(N+1)/2}+\left(\sqrt{5}-1\right)^{(N+1)/2}\right)\\ =\left(\sqrt{5}-1\right)^{(N+1)/2}\cdot\left( \left(\sqrt{5}+1\right)^{N+1}+2^{N+1}\right)\\ \equiv\left(\sqrt{5}-1\right)^{(N+1)/2}\cdot\left( (\sqrt{5}+1)(5^{N/2}+1)+2^{N+1}\right)\\\equiv \left(\sqrt{5}-1\right)^{(N+1)/2}\cdot\left( (\sqrt{5}+1)(1-\sqrt{5})+2^{N+1}\right)\equiv 0. $$