Is there an option to show line numbers in 'Execute JavaScript..." actions?

Hello!

Is there an option to show line numbers in 'Execute JavaScript..." actions?

Снимок экрана 2020-08-05 в 12.55.36

Nope. I'd suggest using a good JavaScript editor, like Visual Studio Code to develop and test your JavaScripts, and all other code.
You can also use BBEdit, which can show line numbers, and is the best general text editor available for the Mac.