For Perform Script On Server, we'd like to pass more context.
Maybe you can make option to pass current record and/or current found set.
So the script on server can be run with having same record selected on server like on client and same found set.
For found set this could be implemented either by passing search parameters and doing same search on server first before running script.
Or by passing the list of RecordID and building found set based on those IDs on server. But that must be documented, so people know the found set can be transferred, with or without search parameters.