Maybe you can use a small stepper motor with linear motion like the ones on the CD head mechanism?

Like this one https://www.aliexpress.com/item/1005...Cquery_from%3A

Ioannis