U.S. Rep. Bob Shamansky (D) stood near a cafeteria Coke machine trying to shake hands with workers on lunch break at a Western Electric plant here.

"You voted for the B1 bomber, right? Seven times, right?" a middle-aged man paused to ask him. "Well, why don't they get that thing geared up so my children can get jobs?"

The differences between Shamansky, 55, and the young challenger who wants to win his seat seem snagged, in the minds of many here, on a recent flap over the B1 triggered by President Reagan.

Shamansky's claim to fame is that he is the dark-horse Democrat who unseated a Republican in a heartland Republican stronghold in the year of the Reagan landslide.

He did it by zeroing in on the issue of jobs against an unexpectedly weak incumbent. He won without help from organized labor.

Now the thin, bespectacled lawyer with the wry grin is struggling neck and neck with his energetic opponent, conservative state Sen. John Kasich, 30. The district had been Republican for 50 years and, based on the latest polls, GOP strategists say they're going to get it back.

The outcome may hinge on the ability of labor groups to turn out the union vote. This time they have pulled out all the stops for Shamansky, whose record on issues of concern to them is tops. One labor leader said he feels "tense" about the prospects.

The president catalyzed interest in the race recently when, on an Ohio campaign swing, he charged that Shamansky had opposed the B1 bomber, a program worth 7,000 jobs here. Kasich's staff had fed Reagan the information.

Shamansky whipped up a series of TV spots accusing his opponent of an attempted smear, saying the president "was lied to and misused in Columbus." Backed by Rep. Clement J. Zablocki (D-Wis.), chairman of the House Foreign Affairs Committee, Shamansky pointed out that he has voted for the bomber every time it came up.

Kasich countered that Shamansky's vote in favor of a nuclear freeze constitutes opposition to the bomber, since the freeze would cancel the production of the B1. The White House also has refused to back off on its interpretation of Shamansky's position.

The incident has helped him, Shamansky says.

Ohio's capital is a bastion of insurance companies, government offices, scientific research and Ohio State University--an oasis of prosperity compared to the state's industrial centers. Still, the unemployment rate here is 9.2 percent.

Kasich, following Reagan's lead, is blaming joblessness on the failed policies of big-spending liberals like Shamansky. With backing from the United States Chamber of Commerce, he tells voters, "I want to get government off our backs and out of our pockets."

Shamansky, claiming he is not liberal but middle-of-the-road, says he is pleased that Reagan is moderating his "wild-eyed, half-baked" supply-side policies, and adds, "I am ready to cooperate with the president and administration in helping correct" those policies.

His campaign manager cites a recent survey showing that he had voted with Reagan 40 percent of the time.

Then there is the experience quotient, summed up in the candidates' slogans: "Walking our way to Congress," say the Kasich ads. His trademark is hoofing it door to door to shake hands with district residents. That's how he won a seat in the state Senate as a virtual unknown, fresh out of Ohio State University.

"Let's keep a congressman who works, not walks," respond the Shamansky forces. A wealthy attorney with 30 years of business experience, Shamansky has a core of support in the local business community and also among the city's government-dependent education and research constituency.