Since you mentioned a refinery, API RP 500 is probably the appropriate Standard. The last actual update with any significant content was 1998. In fact, very little has been changed except for the Appendices since 1990.
Whether you actually use it or not, Appendix D is a good source for reviewing the underlying philosophy of things to consider. Section D.5.7 specifically reviews flanges and valves.
Except for extremely high pressures or unusual operating conditions noted in D.5.7, I tend to ignore flanges. Valves that are operated frequently may need more attention.