Very simple really - the SPEN pin on the lightpen/audio port is usually pulled high internally with a resistor. This means that ports 248 and 504 are constantly updated with the x and y coordinates respectively of the raster beam. If SPEN is held low then those ports ‘stick’ at their current value. So, basically, your lightpen circuit should hold SPEN low and blip it high very briefly when the raster beam passes in front of the photodetector (you could use a photodiode, phototransistor, photodarlington - preferrably a fast one) - this shouldn’t take much more than one i.c.! Note that the x-resolution is not too great, and that line interrupts (often used for palette changes) will not operate. Sorry.