I managed to do almost exactly what you want. The only obstacle is reading the value of “System Type” parameter, which does not seem to cooperate with me. So, as a workaround, I propose to use the “System Abbreviation” parameter, which you can populate maunally in the project by editing piping systems in the project browser. It works pretty much in the same manner.
You will need Rhytm package for Elements.GetParameterValueByNameTypeOrInstance node.
Alas, as a new user I cannot add attachments, so you will have to recreate the script from the screenshot.