Positioning the cursor on the User Prompt

Is there any way I can specify the position of the cursor on the Text input?

The usual %|% doesn’t work because the | sign has another meaning here. Anyway around this?

Yes, but you have to break the string apart yourself, probably it’s easier to use a different token for your purposes, say “HERE”.

So you prompt and your CommentOut variable returns something like “beforeHEREafter”.

Then use the Search using Regular Expression action to break the CommentOut variable based on regex like (.*)HERE(.*) into two variables CommentOutBefore and CommentOutAfter.

Then you use Insert Text %Variable%CommentOutBefore%%|%%Variable%CommentOutAfter%.

Replace HERE with whatever you like (but probably not %|% or anything with percent or backslash characters because that will confuse the token system and make life difficult with the regex etc).

You probably want to detect when the HERE token is not present and just insert CommentOut without positioning the cursor, but whether that is necessary depends on your usage.