Check out this DevCon 2016 session by Jonn Howell:
I had a PSOS routine that did a lot of record deletion and creation, triggered by a button. At first things worked pretty smoothly but when enough people started using this routine and fired it at once the entire system would lock up.
After seeing Jonn's demo I've all but abandoned PSOS for large routines like these in favour of a "script queue" mechanism. The basic premise is that you have a table that stores information on queued routines. When users trigger what would have been a PSOS, it actually just creates a queue record with the script name, parameters, status and other details. The server has a scheduled script that fires every minute. This script finds queue records, loops through them, fires off the appropriate script with parameters, then flags them as complete (or not, if an error is thrown).
That's it in a nutshell... Really, a great presentation and I highly recommend.
Get (RecordOpenState) or the error condition for the Open Record/Request script step can be used to build logical checking when operating on records
Better to open the record and error check. You could check the state and then another user locks the record before the next step opens and locks the record.