I think you underestimate the cost differential between contracting with a lab to drug-test your employees on an ongoing basis, and with hiring a software developer once to make a rudimentary video game that positively correlates a passing score with operating heavy industrial equipment safely for the next 8 hours.
Hell, you could set up an old Atari with Frogger in it, and require employees to score X points before clocking in. It might not have a very strong correlation, but it sure would be cheaper and more goal-specific than drug testing.
It would more likely take the form of "watch this simulated surveillance video of the work floor, and press the space bar to stop the machinery on the entire production line". When someone steps over the warning tape on the floor around the person-shredder, you press the button. If someone gets their sleeve stuck in the dude-grinder, you press the button. If the part-spewer starts stamping out misaligned doohickeys, you press the button. If your response time is too slow, you aren't fit to clock in for today's shift. Or it could be a simulation of operating the actual machine that employee uses, attempting to predict their productivity for the day.
It has the added benefit of sneaking safety training videos into the daily workflow.
Considering that drug tests for operators of heavy machinery are mostly about legal liability, has a system like you propose ever been tested in front of a jury?
You would have to ask a lawyer that specializes in corporate ass-covering. I'm more interested in practical solutions that result in actual safety improvements.
I am not even aware of any jury trial that has decided on the impact of random drug screenings. As far as I am aware, most claims relating to workplace injuries are settled long before the jury pool is even tapped, and many of the remainder are settled before the jury gets a chance to reach a decision. So I think the question you should be asking is if it is likely that any actuary would be willing to analyze the experimental data from such a program, to adjust their company's insurance premiums for anyone using similar software.
If a correlation can be shown, the premiums would be discounted. Actuaries are better with the math than juries are, after all.
A labor union or government regulator could possibly demand such a system in lieu of random drug tests, but your average company does not have enough commitment to worker safety--for its own sake, rather than for its impact on their worker compensation insurance premiums--to experiment in this fashion. They would need a reason that increases revenue or cuts costs.
Hell, you could set up an old Atari with Frogger in it, and require employees to score X points before clocking in. It might not have a very strong correlation, but it sure would be cheaper and more goal-specific than drug testing.
It would more likely take the form of "watch this simulated surveillance video of the work floor, and press the space bar to stop the machinery on the entire production line". When someone steps over the warning tape on the floor around the person-shredder, you press the button. If someone gets their sleeve stuck in the dude-grinder, you press the button. If the part-spewer starts stamping out misaligned doohickeys, you press the button. If your response time is too slow, you aren't fit to clock in for today's shift. Or it could be a simulation of operating the actual machine that employee uses, attempting to predict their productivity for the day.
It has the added benefit of sneaking safety training videos into the daily workflow.