Finally!
Whole thing bothered me quite a while now, but I'm quite certain now: We're using Corona Render including Corona Sky. It seems like the material that appears after I click your script is the internal material for the Corona Sky object. After the material is visible, I can change something inside the Corona Sky object and the changes also happen inside the material. When I delete the material, the viewport background changes and the sky disappears. Looks like the material is solely for the viewport background, because the rendering still works - it is only affecting the viewport. Quite funny: 'Delete Unused Materials' deletes the material too and the background disappears. Adding a new Corona Sky works and the sky is visible again ...
I guess your script digs a little too deep into the material hole in that case. Nothing is lost there, but I imagine it could be frustrating if you don't know what is going on. I've created a new comment in case someone else is looking for that behavior
That is weird.
The plugin retrieves all available materials from the scene, and only changes the flag to show or hide
material.ChangeNBit(c4d.NBIT_OHIDE, showorhide)
Nowhere in the code does it actually create any material.