The metal cases also happen to connect to the logic power. I used a hole reamer to somewhat deburr and slightly enlarge the holes. Then I painted the exposed metal on both the holes and the sensors. Not only does the paint protect the exposed metal from corrosion, but should provide enough electrical insulation in case the phototransistors accidentally touch the sides of the holes again. The metal body proved to be a liability.
Plastic frames are lighter, easier to work with, and self-insulate.
On the other hand, steel is durable, strong, and feels less cheap. Before painting the sensors, I dabbed their lenses with reddish-pink latex mask. After the paint dried, the masks were just peeled off. I poured it over all the backs of the printed circuit boards as further electrical insulation. No need to dry beyond tacky.