Usually this means literally any pen to paper action, not specific to writing in any particular way. Doodling, scratching, or other forms of running a pen across a paper can be of help for thinking.