Pulling up a black screen when wrong ID is read mid trial

I work with nonhuman primates, and we are working on implementing a new system in which the laptops read in the animals unique chip #. So the animals each have their own system, can approach their system at will, and as long as it is the correct chip # they can play their program. If it is the wrong #, black screen appears over the program so that animal cannot complete trials, and the black screen goes away once the correct # is read.

My plan is to have the RFID reader prints to a txt file every 10 ms the chip in the reader (if any at all). I would like to program my psychopgy experiments so that if the incorrect # is detected (meaning the incorrect animal for that system has approached) a black screen is pulled up.

Is it possible for me to have a black screen pulled up if an incorrect chip # is detected mid trial then the black screen disappears and the trial continues once the correct # is detected? Is it even possible to check the txt file for the code every 10 ms mid trial? Or can it only read the txt file at the beginning of every routine?
I have had a lot of issues in the past not being able to change things once a loop has started, so I am worried that once the trial starts, I will not be able to do what I need. Any insight on this would be extremely appreciated.

We are still building the systems so I am not able to test it at the moment, but I wanted to make sure this is something I can even do in the builder with some custom code, or if I need to use other software to create my experiments.