The idea of WOPR is based on the real Soviet system of the early 80s, ВРЯН (вероятность ракетно-ядерного нападения, “the probability of ICBM attack”). It attempted to predict the favorable conditions for a first strike from the US side, giving a signal to the Soviet nuclear planners.
Apparently it didn’t work well, and was decommissioned soon after its activation.
The idea of a "game" that gets confused with an actual nuclear attack is also influenced by the real case in 1979 where a testing tape for the US Early Warning System showing a nuclear attack was accidentally loaded into the production system causing authorities to briefly think the US was under attack.
Apparently it didn’t work well, and was decommissioned soon after its activation.