Possible. Yes.
Easily done. No.
Ridiculously expensive. BIG yes. Especially with low tolerance, and I assume some level of portability, and ability to reprogam.
This might be a question better suited to photonlexicon than laser pointer forums, as it would be a very advanced project. This is more of a beginner - entry level - hobbyist forum.
Edit: A custom diffraction grating, couples with a labbie, if suspended from a specific height, could work. Of course getting that to work with a 5mm tolerance.... good luck.