Take a look at the GetEnvironment function in the help.
In the Environment object you will find these properties:
PBMajorRevision - Will be 19 for PB2019.
PBMinorRevision - Will be 0 for PB2019 GA or R2, 2 for PB2019-R3.
Also interesting but not related to your question:
ProcessBitness - 32 for 32bit or 64 for 64bit.
And if you want to do a Run and wait for it to finish:
https://www.topwizprogramming.com/freecode_runandwait.html
I was able to solve by implementing the example you gave me