I don't think you can define a pen colour because there is a finite number of pens and these are defined in your pen sets (I may be wrong).
Unlike materials and fills where you can have as many as you want.
If you already have the red, green and yellow pens in your pen set then you can use them in your script by hard coding them and not allowing them as a parameter that the user can change.
However changing pen sets may change those colours.
Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11