I am working on a GMAT script out of personal interest (not part of a job) that involves a spacecraft orbiting the Sun-Earth L2 point. I have found some orbital state vectors for the spacecraft that allow a stable halo orbit with minimal delta V correction if I run a stationkeeping script. However, this only works for specific epochs, with the orbits becoming unstable eventually even with stationkeeping (I know halo orbits are not perfectly stable in the short-term, hence the need for stationkeeping, but this seems to be something else relating to the motion of the Sun, Earth and Moon over time. L2 is colinear, so the shifting barycenters due to the motion of the Moon perhaps?).
I want to find the optimal epoch for an L2-Mars transfer, and I want the halo orbit to last for a specific amount of time, so I need to be able to vary the date the spacecraft enters the halo orbit. Therefore, I have been looking for an algorithm or code that can generate state vectors for viable halo orbits in specific dates. I have found some sources of code that appear to do that: Matlab scripts provided J.D. Mireles James, the code in the appendix of this report by Ethan Geipel, this unvalidated code by Christopher Rabotin, and the code at the end of this question, which is a code version of the algorithm described in Kathleen Connor Howell's "Three-Dimensional, Periodic 'Halo' Orbits" paper.
These collections of code appear to do what I'm looking for, but they seem to focus on visualizing the orbits rather than outputting state vectors spacecraft must have to orbit them. I'm also still a complete beginner in understanding trajectories involving Lagrange points, so I'm not completely sure what "computing halo orbits" means in the first place. Therefore my question is twofold: do these scripts indeed do what I think they do, and if yes then how I can use them to acquire the orbital state vectors a spacecraft must have in a specific date to be able to enter a halo orbit?
Sorry for the very beginner question, I'm an amateur and this is my first time ever doing anything with Lagrange points and halo orbits. This is the main reason why I'm looking for a "simple" solution, I have just started educating myself on the topic by reading Robert Farquhar's important papers.