The light needs to be mounted to the print head so it cures as printing.
There are various types of inks such as eco solvent and latex.
For eco solvent you will need tk replace a lot of parts on the printer or it will melt the plastics.
Latex you need a heat source to cure it as it prints.
For the on/off of the led light when over the capping station you can just use a momentary lever switch like used for the backstop, a laser, proximity sensor etc. You just need it to be triggered by the print head as it goes over the capping station.