Is there a such thing as a UV EPROM whose contents cannot be burned unless the UV-sensor is uncovered?
I think we can answer your question quickly by reducing it to


  Is there a such thing as a UV-EEPROM?


I have never heard of one. 


EPROMs (Erasable Programmable Read Only Memories) required the quartz window to allow erasure by UV light.
EEPROMs (Electrically Erasable Programmable Read Only Memory) doesn't need the quartz window since they can be erased electrically.


There is no need for a UV-EEPROM. I'm sure it could be made but why bother?

See EEPROM is a &quot;Read Only Memory,&quot; so why can I write to it? for further details.



Edit after OP changed question to UV-EPROM.


  Is there a such thing as a UV EPROM whose contents cannot be burned unless the UV-sensor is uncovered?


There is no UV sensor in an EPROM. The quartz window exposes the chip to UV for erasure only. There is no way to tell whether the window is covered or not. To do this would require aditional circuitry on the chip and a guaranteed external light source. How would you propose to detect someone programming a chip in the dark?



Edit after resolving the problem through chat:

OP was missing some knowledge of operation of EPROMs and could not understand why the chip would not accept his program. The problem was caused by not erasing before programming. 

Erasure typically sets the bits high so that every byte reads 0xFF. Programming burns the bits to 0 as required and leaves any bits that should be a 1 unchanged. You can not program a 1 into a bit that has been set to 0. Only UV erasure does that.