Vienna — Romania has stepped out of one line and gotten back into another. It got back in line with Western countries - notably West Germany and the United States - after having jeopardized highly advantageous economic links by imposing heavy education taxes on would-be Romanian emigrants to Israel or the West.
But Romania is out of step - once again - with the Soviet Union and Warsaw Pact allies at the European security review conference that has been meeting off and on in Madrid for three years.
The talks hit a new snag with Soviet rejection of Western amendments - and Romanian amendments to the amendments - to a document drafted by eight neutral and nonaligned states in a bid to bring the conference to a ''consensus'' or compromise conclusion. Romania surprised almost everyone by dropping its own amendments to support those proposed by the West.
To many observers it looked like a calculated effort to get relations with the West back on course. Commercial arrangements with Western nations are vital to recovery of the Romanian economy, which is staggering under huge foreign debts.
In Washington President Reagan said Friday that he had received assurances from Romania that it would continue to permit its citizens to emigrate. Apparently it has decided to forgo the education tax.
And the United States is extending Romania's status as a favored trading partner for another year. In March Reagan had warned that Romania would lose ''most favored nation'' status if it did not revoke the tax.
Some 2,500 of the 20,000 Romanians who emigrated last year were admitted to the US. Several thousand went to Israel. But up to 12,000 were ethnic Germans who moved to West Germany under a bilateral 1977 agreement that safeguards emigration rights for the big German minority in central Romania in return for economic concessions.
The education tax threatened renewal of this agreement (due this year) and with it, West Germany's support for the Romanian economy.
West Germany objected strenuously to the education tax, which was reported in some instances to have reached 80,000 marks (some $30,000) payable in hard currency. Romanians are not authorized to hold hard currency, and few had relatives in West Germany with that kind of money.
Some 48 hours before Mr. Reagan's announcement, Bonn disclosed that the German-Romanian agreement is to be extended for five years and the Romanians are waiving the education tax.
Some Western observers regard the tax episode as part of a shrewd - albeit cynical - Romanian ploy to secure maximum economic concessions from the West over an issue the latter sees as a matter of Helsinki-style human rights.
Not long ago, Romanian President Nicolae Ceausescu was rebutting foreign criticisms on the basis that emigration is a domestic matter and asserting that, since the emigrants acquired education and professional skills from the Romanian state, it was both ''moral and correct'' that they should refund those costs when they left the country.
But a sharp drop in trade with West Germany and the prospect of a 50 percent cut in trade with America seems to have changed his mind.
Regard for Western economic ties also seems to explain Romania's decision to support Western amendments emphasizing human rights in the Madrid meeting.