SAN FRANCISCO (AP) _ A divided state Supreme Court on Thursday upheld police roadblocks to check for suspected drunken drivers.

The intrusion on motorists' privacy ''is easily outweighed and justified by the magnitude of the drunk driving menace and the potential for deterrence,'' said Justice Marcus Kaufman in the 4-3 decision.

He said the roadblocks were a regulatory measure to improve public safety, like airport metal detectors, rather than a detention to discover evidence of crime, which would require individual suspicion that a motorist was driving drunk.

Justice Allen Broussard, writing for the dissenters, said the roadblocks were not set up to regulate traffic but ''to detect and punish criminal drunk driving.'' If the court allows criminal detention without individual suspicion of wrongdoing, he said, the next step would be to ''allow preventive detention in high-crime areas.''

The ruling comes in time for the re-establishment of roadblocks by the California Highway Patrol and local police for the upcoming holiday season.

American Civil Liberties Union lawyer Amitai Schwartz, who challenged the roadblocks on behalf of a group of taxpayers claiming misuse of public money, said the ruling ''terribly undercuts the right to privacy in California.''

The roadblocks, which began in the San Francisco suburb of Burlingame in 1984, were suspended in October 1986 after conflicting appellate rulings cast their legality in doubt.

At a roadblock, marked by flashing lights and signs, drivers are generally stopped in a predetermined pattern - every fifth driver, for example. An officer looks at the driver for obvious signs of drunkenness, asks a few questions, and detains an apparently drunken driver for a sobriety test. Other drivers are allowed to proceed.