Here's what I did recently, (
although I did just remove the piece because of non-magnet reasons)
Take a bottle cap that your magnet can fit inside:
- gatorade
- 2 litre of water or soda
- gallon jug of water
- anything that houses water usually
coat the inside with silicone OR reef-safe epoxy and then push the magnet into it,
once the epoxy or silicone dries (at least 24 or 48 hours depending...),
add a layer of silicone on the top side to cover the whole magnet.
Now, I know silicone doesn't adhere to silicone, generally, but you can wrap the whole thing in seran wrap or PTFE tape if you are worried.
It worked for me anyway... just get a plastic cap big enough for the magnet to fit inside, and you have to majority of the magnet's metallic surface "safe" from your reef water, the silicone does the rest.