My general understanding is that thinking about executing the motor tasks in your mind can improve skill. It's not as good as actually practicing the task. I'm not sure exactly how conclusive the literature is on what moderates the effectiveness of mental practice. However, presumably, the nature of the task, the nature of the mental activities performed, your current skill level, and so on, should be relevant.
Perhaps check out Driskell et al (1994) for a review and a meta-analysis. It has a more nuanced treatment. Specifically, they define the relevant act as "mental practice":
Mental practice is the symbolic, covert, mental rehearsal of a task in
the absence of actual, overt, physical rehearsal.
So, it's not just any kind of thinking.
Pascual-Leone, A., Nguyet, D., Cohen, L. G., Brasil-Neto, J. P., Cammarota, A., & Hallett, M. (1995). Modulation of muscle responses evoked by transcranial magnetic stimulation during the acquisition of new fine motor skills. Journal of neurophysiology, 74(3), 1037-1045. https://www.researchgate.net/profile/Aidan_Moran/publication/228118007_Does_Mental_Practice_Enhance_Performance/links/00b49527e74ea53a69000000.pdf