The code used for repair and alterations of an existing system depends on the code used for construction as well as on the requirements imposed by the jurisdiction. Note that getting a permit from the jurisdiction may be necessary for an extensive alteration.

Code of Construction Generally Accepted Code for Repair and Alterations
ASME B31.1 ASME B31.1, Nonmandatory Appendix V – Recommended Practice for Operation, Maintenance, and Modification of Power Piping Systems
ASME B31.3 API 570 – Piping Inspection Code: In-Service Inspection, Rating, Repair and Alteration of Piping Systems
ASME B31.12 ASME B31.12, Chapter GR-5 – Operation and Maintenance
Other Code Unless otherwise specified, the same as requirements for new construction.

Note that getting a permit from the jurisdiction may be necessary for an extensive alteration.