Is this possible?
I want to run a script that at some point it
1 - stops and choose Path pen
2 - I can draw a path not closing it
3 - It detect if the key SPACE is pressed and it continues the script
4 - it cretates a selection from the path and copy it to the memory clipboard
To select the pen yes, to select path no. You would need to create a preset.
Once a script has stopped it can not monitor the keyboard.