Here is an idea of the project. I forgot a lot of it, but I hope you can find something useful here.
I also give links to Amazon to be sure the stuff you need is the right one.
Somewhere I have the Pico's firmware I wrote myself. As soon as possible I will link pinouts and firmware.
I used a couple of sawed nails.
The pen must be pushed down when the servo is not active (when active it pulls it away from the paper): I tried with different springs, but I found that a common elastic band is a lot more effective. If the pen is heavy enough you don't need anything.
Connect the laser cable either to the laser head (in the photo the left floating cable), or to the pen holder.
Doing so you can leave the structure
permanently mounted: it is very light and doesn't disturb the movement of the laser head.
The laser powers the laser head 12VDC: MP1584 DC-DC converter provides the 5VDC to power both the microcontroller and the servo.
The third pin on the laser connector provides a duty cycle that controls the laser power. I feed it
directly into the microcontroller that will understand when it is time to activate the laser.
Laser is considered active if set to a power bigger than 5%.
When the laser is not active, the microcontroller generates the pulses to move the servo actuator's arm up, moving the pen slide upwards.
Laser active => servo off => pen down (helped by an elastic band)
Laser off => servo active => pen up