what is the correct procedure to patch up cinder block hole with plumbing?
You need to make sure that you can have access to the space in case you need to address any issues with the plumbing in the future. ( especially since you have a fernco type rubber fitting installed. )

You should install an   outdoor rated access panel  that either has a hinged door or a removable panel. Either option will need to have hole for the clean out plug as it stands proud of the wall. 

Depending on the size of your opening you may find a metal/plasic access panel in the size you need and then cut a hole in it or you may have to have one manufactured. It should be installed with an outdoor rated sealant or silicone and then screwed to the wall with concrete screws or concrete anchors  with the appropriate fasteners.  

Spray foam may be OK for the adjacent block cavities but i would not surround the plumbing with any material that can not be removed easily, for any future maintenance, stuff fiberglass insulation all around it so you can pull it out if you need to.