Update
I have considered the following scenarios, first:
$$g(t) = \frac{t^2}{2}$$
with the conditions being
$$\partial_t |\psi_0|^2 = 0$$
and
$$\partial_x |\psi_0|^2 + \partial_t^2 |\psi_0|^2 = 0$$
From the first condition $\partial_t |\psi_0|^2 = 0$ I took only the case where $\psi_0 = \psi_0^*$. Adding this to the second condition I got
$$\psi_0 \partial_x^4 \psi_0 + \psi_0 \partial_x \psi_0 - (\partial_x^2 \psi_0)^2 = 0$$
I used a discrete version of this ODE and have computed the initial condition $\psi_0$ using
$$\psi_0^{m+4} = 4\psi_0^{m+3} - 6 \psi_0^{m+2} + 4 \psi_0^{m+1} - \psi_0^{m} + \frac{(\psi_0^{m+3}-2\psi_0^{m+2}+\psi_0^{m+1})^2}{\psi_0^{m+2}} - \Delta x^3(\psi_0^{m+3} - \psi_0^{m+1})$$
and some initial values for $\psi_0^{m=0..3}$ that I chose myself. After a few attempts with the values for $\psi_0^{m=0..3}$, I got to some values that generated the initial condition for the solution that is plotted in the figure.
I have also tested for $g(t) = t$ and managed to change the angle between the "trajectory" a Gaussian beam propagates compared to the propagation axis.
This means that the method works for those cases and probably works for superior orders, but I have not tested them yet.
I consider this question closed.