President Reagan accused Congress yesterday of "inexcusable dithering and delay" on legislation to raise the debt ceiling and require a balanced budget, and House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) called for action by Friday.

Adding to the pressure on Congress to move on the Gramm-Rudman balanced-budget proposal are a threat by the Treasury Department to dip into Social Security trust funds on Friday to meet expenses and a warning from the Republican-controlled Senate that it will toss the whole problem into the lap of the Democratic-run House by midweek.

"On Friday, President Reagan begins shooting hostages and everyone is very aware of it," said Christopher Matthews, an O'Neill aide, referring to the Treasury Department's deadline to begin redeeming Social Security investments unless Congress has acted to raise the debt ceiling.

"Odds are we'll make the deadline" of Friday, said Rep. Vic Fazio (D-Calif.) after an hour-long huddle between O'Neill and House Democratic conferees that reportedly led to an agreement to try to wrap up the matter by week's end.

At a brief session of the House-Senate conference, Senate Finance Committee Chairman Bob Packwood (R-Ore.) imposed an even earlier deadline of Wednesday for a House counteroffer to Gramm-Rudman, the Senate-passed legislation to force a balanced budget by fiscal 1991.

The Senate measure is named for sponsors Phil Gramm (R-Tex.) and Warren B. Rudman (R-N.H.).

Unless there is a House response by Wednesday, Packwood said, he will get the Senate to approve the legislation again and send it back to the House. That maneuver could force Democratic leaders to come up with an alternative to fend off House passage of the Senate measure without change.

The House is in a bind because the Senate has tied its balanced-budget legislation to a measure raising the national debt ceiling to more than $2 trillion. Senators won't consider even a brief extension of the debt limit without a House compromise on the budget measure. Moreover, the House has indicated that it, like the Senate, wants some kind of balanced-budget legislation.

The Treasury Department's threat to dip into Social Security and other trust funds for interim financing of the government adds even more pressure because of acute political sensitivity over Social Security benefits, especially among House Democrats.

In a letter last week to congressional leaders, Treasury Secretary James A. Baker III pointedly raised the prospect of political fallout from a deadlock over the debt measure. Dipping into the trust funds "may raise questions in the minds of present and future recipients of trust fund benefits -- principally pensioners -- about why they have become involved in the debt limit process," he said.

The Senate budget legislation sets ceilings under which deficits would decline from $180 billion to zero over the next five years. If the targets are not met, the president would be required to make across-the-board cuts in most spending programs, except for Social Security.

House conferees are working on major modifications, including limits on presidential powers to determine when and how spending cuts should be made, and easing the impact of the restrictions during recessions.

But they have not yet come up with a counteroffer, and some House conferees argued again yesterday that a final agreement cannot be reached until the administration agrees to abide by all the provisions, including potential defense spending cutbacks.

Defense Secretary Caspar W. Weinberger has said Reagan cannot be bound by any "rigid formulas" on defense because of his constitutional requirements as commander-in-chief, prompting some Democrats to warn that Reagan might simply refuse to sanction defense spending cuts.

But Packwood yesterday rejected a Democratic request for testimony on the issue by Weinberger and Attorney General Edwin Meese III, complaining that such moves were delaying tactics.

"If King Kong popped off and called it the budget legislation unconstitutional, some would want to call the king as a witness," said Packwood tartly. "We didn't have King Kong popping off. We had the secretary of defense," responded Rep. Martin Frost (D-Tex.).

The conference broke off yesterday to allow separate meetings by task forces on specific issues, which are expected to continue today. The full conference is scheduled to reconvene Wednesday.

Reagan's latest criticism of Congress on the budget came in remarks at the White House. "I must warn the Congress that their unwillingness to deal with the debt ceiling and to take responsible action on the deficit is creating a large and unnecessary problem," said Reagan. Cashing in Social Security investments would mean "shortchanging that trust fund of accumulated interest, all because of the inexcusable dithering and delay in meeting the responsibilities about raising the debt ceiling," he added.

Reagan called again for action on overhaul of the tax code, issuing a veiled threat to keep Congress in session. "Believe me, I'm prepared to spend a lot more time with Congress at Christmas this year than either of us originally anticipated," he said.