In a script that could have been written in Hollywood, the space agency has been told to put a close watch on thousands of asteroids and meteors in the far reaches of the solar system in case one moves onto a collision course with Earth.

Deadly serious, the National Aeronautics and Space Administration's Advisory Council said a collision with one of the 800 known sizable asteroids in deep space could destroy most of life on Earth, just as a collision is now believed to have wiped out dinosaurs 65 million years ago. The council said the only way to avoid an impending collision would be to detect the possibility far in advance and deflect the approaching body with a hydrogen bomb.

"In the 130 million years the dinosaurs roamed the Earth, they failed to develop the technology to avoid their own extinction," the advisory council said in a report to nasa that appeared in the newsletter Science Trends. "Homo sapiens has developed an adequate technology. He can avert any further extinction by asteroid impact. We think he should."

Proposing a Spacewatch project, the panel urged NASA to attempt to detect all asteroids and meteors larger than 30 to 60 feet in diameter whose paths cross the Earth's orbit and track them for years to come in case they wander onto a collision course with Earth.

"If a collision appeared imminent, the orbital modification needed to avoid the collision could be determined and a mission deployed to nudge the object off its collision path," the advisory body said. "It would only be necessary to avert impact on the collision encounter of the object, which would then recede again into the . . . background for thousands of years."

To move a meteor or asteroid off its collision path, the council said, a spacecraft carrying a hydrogen bomb could be sent out to the object. It could attach itself to the body, and a radio signal could be sent from Earth to explode the bomb and change the course.

The main reason the advisory council proposed Spacewatch is the growing acceptance by scientists of a theory proposed two years ago by Nobel physicist Luis Alvarez that the dinosaurs were wiped out when a giant asteroid collided with Earth. The collision, according to the theory, threw so much dust into the atmosphere that it blocked out the sun for years, destroying the Earth's plant life and the plant-eating animals like the dinosaurs.

Alvarez found a layer of iridium, a metal uncommon to Earth but abundant in space objects, in numerous samples he took in Europe of the Claystone Layer, formed in the geologic time that separates the Cretaceous and Tertiary periods. More recently, he and his son Walter found the same iridium abundance in the Claystone Layer in eastern Montana, more strongly suggesting it was so widespread that the Alvarez theory of dinosaur extinction is right.

"The likelihood that a similar collision in the future would wipe out the human race," the advisory council said, "led this group to consider 'Project Spacewatch.'"

Even collisions with small bodies pose a danger to the human race in the nuclear age, the council said.

"In the absence of an effective Spacewatch program, an approaching object 10 to 100 meters across could be mistaken for a missile and trigger a nuclear war," the panel said. "Spacewatch may not only save the human race from the fate of the dinosaurs, it may even save it from itself."

The council came up with still another rationale for Spacewatch. The same telescopes and radio antennas built for Spacewatch could peer deeper into space to search for life on other worlds. Said the groups: "In the course of saving our own lives, we may discover our neighbors."

The advisory council estimated NASA could start Spacewatch for $500,000 a year, which would buy a computer to log the asteroids tracked by an existing telescope. A larger program involving radar and at least one additional telescope would cost as much as $50 million. The panel also suggested a rendezvous mission in 1985 with a large asteroid; that would cost $100 million but would answer the question of whether an asteroid really could be blown off course.