The fiscal 1988 spending and deficit reduction legislation awaiting final approval by Congress is a mixed blessing for the metropolitan area, providing millions in new federal projects for Maryland and Virginia while forcing District officials to tighten their belts a little.

Maryland appeared to have done the best of all among the three jurisdictions in the annual battle for pork, aided by the team of freshman Sen. Barbara A. Mikulski (D-Md.) on the Senate Appropriations Commitee and veteran Rep. Steny H. Hoyer (D-Md.) on the House Appropriations Committee.

The catchall spending legislation includes $6.7 million toward a planned $21 million computer-linked "super library" in Prince George's County; $6 million for engineering and design of a new national archives building to be built in Maryland, and $1.4 billion in funding for programs at the Goddard Space Flight Center and other high-tech facilities in the state.

"Given the budgetary constraints we faced this year, this bill represents a real victory for Maryland and the Washington metropolitan area," Mikulski said yesterday. ". . . We won some, we lost some, but we worked on them all."

Mikulski also inserted language in the defense portion of the spending bill to permanently bar the Navy from undertaking a controversial plan to build an electromagnetic pulse simulator in the Chesapeake Bay that critics contend would endanger the environment and disrupt commercial shipping.

The so-called EMPRESS II project is designed to test the effects on sensitive Navy electronic equipment from pulse radiation similar to that emitted during an atomic explosion. Under the measure, the Navy would be forced to find an alternate site unless it can certify that national security concerns outweigh the economic, social and environmental costs of testing in the bay.

In the area of transportation, the spending package includes $180.5 million in Metro construction funds -- a 10 percent reduction from the $201 million allotted in fiscal 1987 -- to help complete the long-awaited Green Line spurs to Greenbelt and Anacostia.

Rep. Frank R. Wolf (R-Va.), another member of the House Appropriations Committee, hailed the Metro funding level as "important for the region," noting that the total exceeds the Reagan administration recommendation by $50.5 million. Wolf and Hoyer fended off further cuts in Metro funding.

"I think we did very well," said Wolf, who serves on the Appropriations transportation subcommittee. "The needs of the area are well met . . . . Let's face it, we have a deficit in the country, and if they're going to be cutting the Federal Aviation Administration, then every other area {of transportation} has to receive its share of proportional reductions."

Other funds for area transportation projects, according to Wolf's office, include $3.9 million for the final phase of improvements to Rte. 1 in Arlington, near National Airport; $14.25 million for improvements to the Baltimore-Washington Parkway; and $500,000 for noise barriers along I-66 near the community of Falls Hill in Fairfax County.

Also, about $237,500 was included to update information used by the Metropolitan Washington Council of Governments for transportation planning and an unspecified amount for a study of ways to improve traffic flow on the Woodrow Wilson Bridge by adding lanes or decks or by building another bridge.

Another measure obtained by Wolf directs the D.C. government to develop a plan for construction of a fourth inbound lane on the Theodore Roosevelt Bridge.

District officials said they prepared for the worst in approaching this year's budget battle on Capitol Hill but suffered only moderate cutbacks in federal spending. The spending bill contains $550 million in federal operating funds for the District for the fiscal year that began Oct. 1, or about $10.3 million less than in the previous year.

"It's belt-tightening time . . . but on the whole we did pretty well," said Julius W. Hobson Jr., the District's chief congressional lobbyist.

Under the compromise worked out by Senate and House conferees, the federal payment -- covering the city's costs of providing services to the federal government -- was reduced from $444.5 million to $430.5 million. Also, a $20 million payment toward the proposed D.C. prison was deferred for a year.

But Congress agreed to boost its payments for sewer and water services from $28.8 million last year to $32.6 million in fiscal 1988, along with $7.9 million to cover back charges.

Last week, House and Senate conferees agreed to drop a Senate amendment to freeze all spending by the District unless the D.C. Council agreed to overturn a law prohibiting insurers from requiring AIDS virus tests -- a victory for District officials.

However, the conferees agreed to retain language that puts the 800-bed D.C. prison construction project on hold until at least mid-March while three sites are reexamined. As of late yesterday, conferees were still working out precise language dealing with the law on acquired immune deficiency syndrome and the prison project. LOCAL BENEFITS -------------------

METRO FUNDS

$180.5 million to help complete Green Line spurs to Greenbelt, Anacostia.

MARYLAND

$6.7 million for "super library" in Prince George's County.

$6 million for new National Archives building.

$1.4 billion for programs at high-tech facilities.

$14.25 million for improvements to Baltimore-Washington Parkway.

VIRGINIA

$3.9 million to finish improvements to Rte. 1 in Arlington.

$500,000 for noise barriers along I-66 near Falls Hill community.

D.C.

Payments for sewer, water services to be boosted from $28.8 million last year to $32.6 million in 1988.