Twelve days after the seizure of Trans World Airlines Flight 847, President Reagan is placing his administration's prestige and possibly the lives of 40 U.S. hostages on the line by threatening unspecified steps if diplomacy does not begin to work within a few days.

Reagan's decisions, as described by White House spokesman Larry Speakes following a National Security Council meeting yesterday, represent the first major shift in administration policy since the hostage episode began. The change is apparently intended to bring diplomatic efforts to a head, producing either clear-cut signs of success or U.S. admission that diplomacy has failed and it is time to move to overt pressure tactics.

The president's logic seems to be that this is a chance, perhaps a last chance, to cut short the drawn-out posturing anprided himself on avoiding Carter's pitfalls, but the similarities are growing.

On the ground in Lebanon, time also seems to be working against Reagan because of a power struggle raging among the Lebanese Shiite factions and the possibility of new demands on top of the demand for Israel to release about 700 Lebanese prisoners.

The most dramatic evidence of the intra-Shiite conflict was the march of more than 1,000 Hezbollah (Party of God) militants last Friday near the hijacked TWA plane at Beirut airport. The real target is believed here to have been Nabih Berri, the leader of the rival Amal faction.

Amal is holding most of the American hostages, but about six are believed held by Hezbollah. The struggle between the factions seems to have intensified in recent days, with the hostages as pawns.

The main hopes for early diplomatic resolution of the situation rests on Lebanon's two neighbors, Israel and Syria.

Israel is feeling growing pressure from U.S. public opinion to release its Lebanese prisoners. Vice President Bush's statement in Bonn yesterday calling for release of "people being held against international law" suggested subtle pressure of the same sort from the administration.

Syria is the other powerful actor. President Hafez Assad is believed to be opposed to the holding of the hostages and inclined to help, but he has taken no direct action. Earlier, Assad expressed similar sentiments regarding six or seven other Americans who were kidnaped before the TWA hijacking and have been held prisoner in the Bekaa Valley, but he has been unable or unwilling to act.

The cagey Assad returned Saturday from a meeting with Soviet leader Mikhail Gorbachev in Moscow and has just played host in Damascus to Iranian Majlis (Parliament) Speaker Ali Akbar Hashemi Rafsanjani. U.S. officials are hopeful, but by no means confident, that he will now use his considerable influence within Lebanon to arrange the hostages' freedom.

With his latest decisions, Reagan seems to be saying to Assad, "Now is the time to act or be tagged with some of the blame and some of the consequences if you fail to do so."