People learning Special Relativity are too often told that it is only a theory that works for inertial frames. This is not true. Special Relativity is simply a gravitational theory in flat space.
Let me clarify.
(The next few paragraphs are given for people just learning relativity and can be skipped for those familiar with the four-vector formalism.)
The essence of special relativity is the definition of the Lorentz-Invariant measure of proper time. For two events separated by a time $\Delta t$ and a spacial displacement $\Delta\textbf{x}$, we define
$$\Delta\tau^2=\Delta t^2-\Delta\textbf{x}^2$$
In units where $c=1$. To check that this is Lorentz-Invariant, a light pulse will also have $\Delta t=|\Delta\textbf{x}|$, and so $\Delta\tau=0$. Under Lorentz transformations, since the speed of light is kept constant, this is invariant. The invariance for other velocities can be easily checked.
The geometrical interpretation of this invariance is at the heart of SR and GR. If we define a four-vector as a vectoral object, $x^{\mu}$, with four components ($\mu=0,1,2,3$) such that $x^0=t$, $x^1=x$, $x^2=y$, and $x^3=z$. Then the infinitesimal form of the proper time is given by
$$\mathrm{d}\tau^2=\eta_{\mu\nu}\,\mathrm{d}x^{\mu}\,\mathrm{d}x^{\nu}$$
Where $\mu$ and $\nu$ are implicitly summed over and $\eta$ is a matrix with elements
$$\eta=\begin{pmatrix}1 & 0 & 0 & 0\\ 0 & -1 & 0 & 0\\ 0 & 0 & -1 & 0\\ 0 & 0 & 0 & -1\end{pmatrix}$$
This is an example of what we call a metric tensor. For now it's not too important to understand the geometry of the metric tensor, just think of it as the matrix that calculates the "distance" between two objects.
Note, however, what happens when we change coordinates $x^{\mu}\to\xi^{\mu}$, where the $\xi$ coordinates depend arbitrarily on the $x$ coordinates. We have
$$\mathrm{d}\tau^2=\eta_{\mu\nu}\left(\frac{\partial x^{\mu}}{\partial\xi^{\rho}}\mathrm{d}\xi^{\rho}\right)\left(\frac{\partial x^{\nu}}{\partial\xi^{\sigma}}\mathrm{d}\xi^{\sigma}\right)\equiv g_{\rho\sigma}(\xi)\mathrm{d}\xi^{\rho}\mathrm{d}\xi^{\sigma}$$
Where we have defined a new beast, $g(\xi)$, which is now a metric tensor that depends on the position in spacetime. This is the fundamental object in GR (even though we're not doing GR!).
Let us actually compute an example of this. In spherical coordinates, we have $t=t$, $x=r\cos{\phi}\sin{\theta}$, $y=r\sin{\phi}\sin{\theta}$, and $z=r\cos{\theta}$. Transforming the coordinates, we have
$$\mathrm{d}\tau^2=\mathrm{d}t^2-\mathrm{d}r^2-r^2\left(\mathrm{d}\theta^2+\sin^2{\theta}\mathrm{d}\phi^2\right)$$
The coefficients of the differential coordinate changes depend on position!
There is another example (which is more relevant to what you want), called Rindler coordinates, in which the proper time element is given as
$$\mathrm{d}\tau^2=a^2x^2\mathrm{d}t^2-\mathrm{d}\textbf{x}^2$$
Although it isn't obvious, these coordinates describe constant acceleration $a$ in the $x$ direction, and are related to the intertial frame by the transformations
$$t\to\frac{1}{a}\text{arctan}\left(\frac{t}{x}\right),\hspace{0.5cm}x\to\sqrt{x^2-t^2},\hspace{0.5cm}y\to y,\hspace{0.5cm}z\to z$$
Since there is a coordinate transformation that relates this accelerating frame to a flat frame, it is perfectly compatible with special relativity.
Okay, this is a lot of talk about Special Relativity with no mention of how it relates to General Relativity. The basic idea is that in General Relativity there is not necessarily a transformation which takes the metric tensor $g$ to the flat metric $\eta$ at every point. It does, however, allow a transformation at any point $X$ such that $g(X)=\eta$ and $\partial_{\mu}g(X)=0$ (here, $\partial_{\mu}=\partial/\partial x^{\mu}$). This is what the equivalence principle really says.
Near a gravitational body, the metric tensor is approximately given by a Rindler metric (that is exactly the same as saying that near a gravitational body we can approximate the field as a constant acceleration). Since there is a transformation from Rindler to flat coordinates, we have that there is a set of coordinates (namely, free-falling coordinates) such that a gravitational field looks locally inertial!
I've taken a lot of time to explain to you why the equivalence principle works. That was a very long detour, and so now let's get to the heart of your question: the propagation of light in an accelerated frame vs a gravitational field.
I'll answer the last part of your question first. The results would have been identical if the laser pulse for the accelerated observer was created within the compartment or outside of it, as far as the intervals between emission and absorption are concerned.
As for the first part of your question: you consider a scenario in which a pulse is released periodically from a laser and you measure its path. In this coordinate system, the path itself is independent of time. However, in the inertial frame, since the actual laser itself is moving, the point at which the pulse lands is clearly time dependent. The compartment is not only moving, but it is contracted more and more the faster it goes. The interpretation that the inertial observer sees the compartment going faster and faster while it is getting shorter and shorter, so that the pulse is always hit at the same spot on the compartment.
I hope this is helpful. If anything is unclear (as it usually is in problems like this), feel free to ask questions!