Legislation signed by President Reagan directs the Environmental Protection Agency to draw up a plan to track infectious medical wastes such as those that washed up on Atlantic Coast beaches last summer.

White House officials on Wednesday announced that Reagan had signed the bill. The president was campaigning for Vice President George Bush in Wisconsin at the time.In a statement, Reagan was quoted as calling the bill "an important step forward in the protection of our environment because it will ensure that those who generate, handle or dispose of medical waste are accountable, and it will encourage proper handling and disposal of such potentially dangerous waste."

The tracking system for medical waste initially would apply to only 10 states: Connecticut, New Jersey, New York, Pennsylvania, Ohio, Indiana, Michigan, Illinois, Wisconsin and Minnesota.

The program, however, could become national in scope because any other state could decide to have its medical waste covered by the plan and gain authority to act against incoming waste not meeting the tracking requirements.

Congress acted after waves of used syringes, vials of AIDS-infected blood and other hospital waste washed up on beaches along the East Coast, Lake Michigan and Lake Erie during the summer. The waste became a health problem, closing some beaches because of the threat of hepatitis and other diseases.

The new law requires EPA to set up a system to track dangerous waste from hospitals, labs and clinics to its disposal.

Blood, hypodermic needles, scalpels and surgical and laboratory waste that had been in contact with infectious agents all would have to be tracked. The materials would have to be segregated from other medical waste and documented to make sure they reached a proper disposal facility.

Lawmakers had accused EPA of failing to use its regulatory authority to resolve the problem.