I posted this earlier. I by no means an expert but I did some research and I found that something called a Dyne pen test is probably the most practical, affordable, and dependable method. It’s fast, simple, and visual. If legal or high stakes accusations are involved at a tournament setting then send the cue ball to a lab for further confirmation.As for detecting stuff on the ball, there is equipment that can tell the chemical composition of materials at levels far lower than what would be on the ball. Not cheap, so the ball would likely have to be sent to a lab.
I think a better idea is to have a new cue ball for each rack, and no impromptu cleaning by the players. Cue balls do change some during a match if they aren't cleaned.
Sign of the times when stakes are high look what the poker world does for preventing “cheating.”