The State Bank of Prince William County, a small community institution that has been plagued by scandal and misfortune, is making a brave attempt at a comeback. President P. Richard Malloy told stockholders at yesterday's annual meeting that the bank had finally edged back into the black in March, showing a profit of $1,821.

That bit of good news followed two dismal years. In 1981, the bank suffered a net operating loss of $257,906 after a loss of $183,768 the previous year. Assets shrank by 22 percent to $8.8 million last year, and the bank lost $2.4 million in deposits. Its loan charge-offs went up to $30,039, more than threefold over 1980.

The bank's major troubles date from 1980, when then-president Cecil Shiflett resigned after his son, Wayne, a bank vice president, was accused of embezzling about $60,000 from State Bank, a charge to which Wayne later pleaded guilty. The bank's computer operations under Cecil Shiflett went haywire.

Federal and state bank regulators put State Bank on the problem list, and the bank is still operating under a cease and desist order. The annual meeting was delayed for six months while stockholders demanded to know what was going on.

Then the book value of the stock was reduced from $8 to $6 to give the bank a badly needed infusion of capital. There were rumors of a takeover.

At yesterday's meeting, Malloy said State Bank has filed suit against the computer company, NCR, which now wants to settle the complaint by arbitration. He also said directors would forego their fees until the bank regained its profitability. Several stockholders grumbled that the directors should not have been paid over the past few months when the bank was in the red.

Malloy added that the staff had been trimmed by a third, that fees had been levied on small checking accounts, and that State Bank would soon offer customers "sweep" accounts that put idle funds over a minimum into a money market fund. He projected flat earnings for 1982 "at best."

Stockholders agreed to increase the number of directors to 11 to include John B. Christian, 28, vice president of the Landmark Companies. Christian's boss is David Bindeman, who reportedly tried to get on the board himself but was refused by federal regulators. Bindeman is a Northern Virginia real estate developer. He has been actively buying stock in State Bank recently from long-time shareholders at $9 and up a share. The extended Bindeman family, consisting of several brothers and their relatives, now holds the largest block of State stock, according to Malloy.

Bindeman was optimistic yesterday about the bank's future. He urged the shareholders to spend as much time drumming up business as they have spent complaining about its past.