Final passage of the District of Columbia's antismoking law looked like a cinch. Just two weeks ago, it received preliminary approval from the City Council on a unanimous voice vote.

Fearing enactment, which would have made the nation's capital a highly visible symbol of antismoking sentiment, the Tobacco Institute - the industry's Washington-based trade group - retained Larry C. Williams Sr. as its lobbyist, paying him $3,000 a month.

The investment in Williams, a Washington lawyer-lobbyist who has good connections with officials in the home rule government, among them City Councilman Marion Barry (D-At Large), paid off handsomely yesterday.

Before supporters of the antismoking bill even knew what had happened to them, the council voted 7 to 6 to table the measure - an action that leaves it close to dead, but just alive enough to merit continued surveillance by lobbyist Williams.

"Man, that was close," Williams said to nobody in particular as he stepped into an elevator after the vote. "My people really didn't want that thing."

To hear Williams tell it, he had not lobbied at all - he had prepared a scholarly 16-page legal brief explaning the constitutional pitfalls the council faced in enacting the bill.

Aiding in the research, he said in a letter distributed to all 13 council members, was Prof. Herbert O. Reid of the Howard University Law School and "the prestigious Washington law firm of Covington & Burling."

There was little in the debate yesterday to suggest that council members had read the brief. There was little to suggest, until it happened, that the bill was doomed to defeat.

The measure, which had been under consideration for nearly two years since it was introduced by the late council member Julius Hobson Sr., would have barred smoking in all official public gatherings and numerous places where people congregate - such as in beauty shops.

When the bill was called up for action yesterday by its chief sponsor, Jerry A. Moore Jr. (R-At Large), the assault was led by Willie J. Hardy (D-Ward 6). She is one of two smokers on the council. The other is John A. Wilson (D-Ward 1).

Hardy had been absent two weeks previously, when the bill won preliminary approval, so this was her first crack at its provisions. It would be hypocritical, she said, for council members who had advocated easing penalties on marijuana "to make it a crime to smoke a legal cigarette" - which, she added, provides revenue for the city.

Nadine P. Winter (D-Ward 6), who at an earlier stage had specifically supported the smoking ban in beauty shops, said she had heard from angry beauty parlor owners who didn't want to have to call the police to arrest smoking customers.

Hardy's first try to cut some of the stricter provisions from the bill failed on a vote of 6 to 5, with one abstention.

But then, after a few more minutes of debate, she moved to take the bill - to put it in limbo, where it can be revived only by a majority vote of the council.

The vote to take was 7 to 6. In voting to shelve the bill, Hardy was joined by Democrats Douglas E. Moore, Wilhelmina J. Rolark, William R. Spaulding, Winter, Barry and Arington Dixon. Opposed were Jerry Moore and Democrats Polly Shackleton, Sterling Tucker, Wilson and David A. Clarke and Statehood Party member Hilda Mason (who occupies Hobson's former seat).

While the debate and vote were going on, Williams was sitting in the rear of the council chamber, whispering occasionally to a Tobacco Institute staff member.

Williams' role was never mentioned out loud by any of the council members at the front of the room.

But afterward, one backer of the bill said "there was no doubt" that Williams had turned the tide. Williams himself, asked if his lobbying had was responsible for the defeat of the bill, said he would "prefer to think it was my legal arguments." stated in his brief.

Williams said he had talked to probably every council member except Dixon and Tucker, but some of the others said they either had not talked with Williams or had merely received the letter and the brief.

Williams is no stranger to any council member. In 1975, he was the highest paid lobbyist registered at the council, receiving $14,600 to oppose a ban on nonreturnable soft-drink bottles and $18,445 from a funeral director's group. He also has represented the city's liquor industry.