Your thinking is correct.
Snell's Law $$n_1\sin\theta_1=n_2\sin\theta_2=n_3\sin\theta_3=...$$ applies continuously as the ray crosses multiple layers of refractive material, provided that the refractive index varies in only one direction, and that the angles of incidence $\theta_1,\theta_2$ etc are measured relative to that direction. The variation can be smooth and continuous, it need not be abrupt changes between distinct layers. It does not need to vary monotonically (constant increase or decrease), it can vary anyhow.
To find the angle at which the ray emerges you only need to consider the 2 mediums in which the ray enters and emerges. It does not matter what layers it has passed through in between. If these 2 mediums are the same (eg air) then the beam emerges parallel to the direction from which it entered.
However, this theorem will not tell you how much the ray has deviated from its initial line of travel. Neither will it tell you how much the ray has been attenuated due to absorption in each layer or reflections at the interfaces between layers.
Neither can the theorem tell you whether the ray undergoes total internal reflection at one of the interfaces between layers of material. In that case the ray will emerge from the face which it entered, or a side face if the slab of multi-layer material is not wide enough. To find out if this happens you need to trace the ray through the layers, checking what happens at each boundary.