''It's a wonderful irony that 18th century money should become available just when we need it for our problems today,'' said James M. Shannon, the Attorney General of Massachusetts and one of the officials involved in trying to determine who will get Franklin's bequest. ''I would hate to have it end up just funding the debt,'' Mr. Shannon added, refering to Massachusetts' nettlesome $1 billion state budget deficit.

Franklin, who was born in Boston but moved to Philadelphia at age 17, left the money in a codicil to his will. He specified that the $:2,000 be divided equally between Boston and Philadelphia for use as loans for young apprentices as he had once been. Then, 100 years after his death, part of the money should be disbursed, with the remainder given out a century later.

Franklin's instructions also provided that at the end of the 200 years the balance of the money in the Boston trust be divided, with 26 percent going to the city and 74 percent to Massachusetts. He made a similar arrangement with Philadelphia and Pennsylvania, but he did not spell out how the final sums should be spent, ''not presuming to carry my views farther,'' he said in the will.

The balance in the Boston trust is now $4.5 million, while the money in the Philadelphia account is valued at $2 million. The large difference in the value can be traced to the wiser handling of the investment in Boston, said Whitfield Bell, a historian and the curator of the American Philosophical Society in Philadelphia. The philosophical society was one of a number of intellectual organizations founded by Franklin.

In recent years the Philadelphia bequest has been managed by the Board of City Trusts, while in Boston it has been managed since the early part of the century by the trustees of the Franklin Institute, which include some representatives of organizations named for the job in Franklin's will.