Hello,
Good News. I've just checked it. It is working fine. With this code in place, user won't be able to createa PM02 type Order, in case there are open Orders (non-TECO, non-CLSD) of any type, are existing in the system on the Equipment on which present Order is being created. I checked it repeatedly.
You too check from your side and revert in case of issues.
Best of Luck
KJogeswaraRao