There are two versions of this story that I know. One version can be found in Mahabharata, Ashwamedha Parva SECTION IX and SECTION X.
Vrihaspati said, "O Indra, I have heard that Marutta will perform a great
sacrifice at which exquisite presents will be given by him (to Brahmanas) and that at his sacrifice Samvarta will act as the officiating priest, and therefore do I desire that he may not officiate as priest at that sacrifice."
Indra said, "Thou, O Brahmana, hast attained all the object of thy desire when thou hast become the excellent priest of the gods, versed in all the sacred hymns, and hast overreached the influence of death and dotage, what can Samvarta do to thee now?"
Vrihaspati said, "Prosperity of a rival is always painful to one's feelings, and for this reason too, thou dost with try attendant gods persecute the Asuras with their kith and kin, and kill the most prosperous among them; hence, O Lord of the gods, am I changed in appearance at the thought that my rival is prospering, therefore, O Indra, do thou, by all means, restrain Samvarta and king Marutta."
Indra turning to Agni said, "Do thou, O Jataveda, following my direction, go to king Marutta to present Vrihaspati to him, and say unto him that this Vrihaspati will officiate at his sacrifice and make him immortal."
Agni said, "I shall presently, O adorable one, repair thither as thy messenger, to present Vrihaspati to king Marutta; and to make Indra's words true, and to show respect to Vrihaspati, Agni departed."
Vyasa said, "Then the high-souled fire-god went on his errand, devastating all the forests and trees, like unto the mighty wind, roaring and revolving at random at the end of the winter season."
Marutta said, "Behold! I find the fire-god come in his own embodiment, this day, therefore do thou, O Muni, offer him a seat and water, and a cow, and water for washing the feet."
Agni said, "I accept thy offerings of water, seat, and water for washing the feet, O sinless one, do thou know me as the messenger of Indra, come to thee, in accordance with his directions."
Marutta said, "O Fire-god, is the glorious Lord of the Celestials happy, and is he pleased with us, and are the other gods loyal to him? Do thou enlighten me duly on all these points."
Agni said, "O lord of the earth, Sakra is perfectly happy, he is pleased with thee, and wishes to make thee free from senility, and all the other gods are loyal to him. Do thou, O king, listen to the message of the Lord of the Celestials. And the object for which he has sent me to thee is to present Vrihaspati to Marutta. O prince, let this priest (of the Celestials) perform thy sacrifice, and make thee, who art only a mortal, attain immortality."
Marutta said, "This twice-born Brahmana Samvarta will perform my sacrifice, and I pray to Vrihaspati, that he having acted as priest to Mahendra (Indra), it does not look well for him now to act as priest to mortal men."
Agni said, "If this Vrihaspati officiate as thy priest, then shalt thou by the blessings of Devaraja (Indra) attain the highest region in the celestial mansion and attaining fame shalt thou certainly conquer the heavenly region. And, O lord of men, if Vrihaspati act as thy priest, thou shalt be able to conquer all the regions inhabited by men, and the heavenly regions, and all the highest regions created by Prajapati and even the entire kingdom of the gods."
Samvarta said, "Thou must never come again thus to present Vrihaspati to Marutta: for know, O Pavaka, (Agni) if thou dost, I losing my temper, will burn thee with my fierce evil eyes."
Then Indra send a Gandharva naming Dhritrastra to convey his message.
"Indra said, "Even so it is; the might of Brahmanas is great and there are none more powerful than Brahmanas, but I can never bear with equanimity the insolent pride of Avikshita's son, and so shall I smite him with my thunderbolt. Therefore, O Dhritarashtra, do thou according to my direction repair to king Marutta attended by Samvarta, and deliver this message to him--'Do thou, O prince, accept Vrihaspati as thy spiritual preceptor, as otherwise, I shall strike thee with my terrific thunderbolt.'"
Vyasa said, "Then Dhritarashtra betook himself to that monarch's court and delivered this message to him from Vasava."
Dhritarashtra said, "O lord of men, know that I am Dhritarashtra the Gandharva, come here with the object of delivering to thee the message of Indra. Do thou, O lion among kings, listen to the words which the high-souled lord of all the worlds meant for thee,--That one of incomprehensible achievements (Indra) only said this much, 'Do thou accept Vrihaspati as thy officiating priest for the sacrifice, or if thou do not comply with my request, I shall strike thee with my terrific thunderbolt.'"
Marutta said, "Thou, O Purandara, the Viswadevas, the Vasus and the Aswins ye all know, that in this world there is no escape from the consequences of playing false to a friend; it is a great sin like unto that of murdering a Brahman. Let Vrihaspati (therefore) officiate as priest to that Mahendra the supreme Deva (god), the highest one wielding the thunderbolt, and O prince, Samvarta will act as my priest, as neither his (Indra's) words, nor thine commend themselves to me."
The Gandharva said, "Do thou, O lion among princes, listen to the terrible war-cry of Vasava roaring, in the heavens. Assuredly, and openly will Mahendra hurl his thunderbolt at thee. Do thou therefore be-think thyself of thy good, for this is the time to do it."
Vyasa said, "Thus accosted by Dhritarashtra, and hearing the roar of howling Vasava, the king communicated this intelligence to Samvarta steadfast in devotion and the highest of all virtuous men."
Marutta said, "Verily this rain-cloud floating in the air indicates that Indra must be near at present, therefore, O prince of Brahmanas, I seek shelter from thee. Do thou, O best of Brahmanas, remove this fear of Indra from my mind. The Wielder of the thunderbolt is coming encompassing the ten directions of space with his terrible and superhuman refulgence and my assistants at this sacrificial assembly have been overcome with fright.
Samvarta said, "O lion among kings, thy fear of Sakra will soon be dispelled, and I shall soon remove this terrible pain by means of my magic lore (incantation); be calm and have no fear of being overpowered by India. Thou hast nothing to fear from the god of a hundred sacrifices. I shall use my staying charms, O king, and the weapons of all the gods will avail them not. Let the lightening flash in all the directions of space, and the winds entering into the clouds pour down the showers amid the forests and the waters deluge the heavens and the flashes of lightning that are seen will avail not. Thou hast nothing to fear, let Vasava pour down the rains and plast his terrific thunderbolt where he will, floating among the watery masses (clouds) for thy destruction, for the god Vahnni (Agni) will protect thee in every way, and make thee attain all the objects of thy desire."
Marutta said, "This appalling crash of the thunderbolt together with the howling of the winds, seem terrible to my ears and my heart is afflicted again and again, O Brahmana, and my peace of mind is gone at present."
Samvarta said, "O king, the fear in thy mind from this terrible thunderbolt will leave thee presently. I shall dispel the thunder by the aid of the winds, and setting aside all fear from thy mind, do thou accept a boon from me according to thy heart's desire, and I shall accomplish it for thee."
Marutta said, "I desire, O Brahmana, that Indra all on a sudden should come in person at this sacrifice, and accept the oblation offered to him, and that all the other gods also come and take their own shares of the offerings and accept the libations of Soma offered to them."
Samvarta said, "I have by the power of my incantations attracted Indra in person to this sacrifice. Behold, O monarch, Indra coming with his horses, and worshipped by the other gods hastening to this sacrifice."
Then the lord of the Devas attended by the other gods and riding in his chariot drawn by the most excellent steeds, approached the sacrificial altar of that son of Avikshit and drank the Soma libations of that unrivalled monarch. And king Marutta with his priest rose to receive Indra coming with the host of gods and well-pleased in mind, he welcomed the lord of the Devas with due and foremost honours according to the Sastras.
Samvarta said, "Welcome to thee, O Indra, by thy presence here, O learned one, this sacrifice has been made grand. O slayer or Vala and Vritra. do thou again quaff this Soma juiced produced by me today.'
Marutta said, "Do thou look with kindness upon me, I bow unto thee, O Indra, by thy presence, my sacrifice has been perfected, and my life too blessed with good results. O Surendra, this excellent Brahmana, the younger brother of Vrihaspati is engaged in performing my sacrifices."
Indra said. "I know thy priest, this highly energetic ascetic, the younger brother of Vrihaspati, at whose invitation I have come to this sacrifice. I am, O monarch, well-pleased with thee and my resentment against thee hath been destroyed."
Samvarta said, "If, O prince of the Devas, thou art pleased with us, do thou thyself give all the directions for this sacrifice, and O Surendra, thyself ordain the sacrificial portions (for the gods), so that, O god, all the world may know that it hath been done by thee."
Vyasa said, "Thus accosted by the son of Angira, Sakra himself gave directions to all the gods to erect the hall of assembly, and a thousand well-furnished excellent rooms looking grand as in a picture, and speedily to complete the staircase massive and durable, for the ascent of the Gandharvas and Apsaras and to furnish that portion of the sacrificial ground reserved for the dance of the Apsaras, like unto the palace of Indra in the heaven. O king, thus directed, the renowned dwellers of heaven speedily fulfilled the directions of Sakra. And then, O king, Indra well-pleased and adored, thus said to king Marutta,--O prince, by associating with thee at this sacrifice, thine ancestors who have gone before thee, as well as the other gods have been highly gratified and have accepted the oblations offered by thee. And now, O king, let the foremost of regenerate beings offer on the sacrificial altar a red bull appertaining to the Fire-god and a sacred and duly consecrated blue bull with a variegated skin, appertaining to the Viswedevas. Then, O king, the sacrificial ceremony grew in splendour, wherein the gods themselves collected the food, and Sakra, the lord of the gods, possessed of horses, and worshipped by the Brahmanas, became an assistant at the sacrifice. And then the high-souled Samvarta ascending the altar, and looking radiant as the second embodiment of the blazing fire, loudly addressing the gods with complaisance, offered oblations of clarified butter to the fire with incantation of the sacred hymns. And then the slayer of Vala first drank the Soma juice, and then the assembly of other gods drank Soma. And then in happiness and with the king's permission they returned home and well-pleased and delighted.
So, the yagna was completed successfully. Almost similar version of story is mentioned in Srimada Bhagavatam SB 9.2:
SB 9.2.26 — From Karandhama came a son named Avīkṣit, and from Avīkṣit a son named Marutta, who was the emperor. The great mystic Saṁvarta, the son of Aṅgirā, engaged Marutta in performing a sacrifice [yajña].
SB 9.2.27 — The sacrificial paraphernalia of King Marutta was extremely beautiful, for everything was made of gold. Indeed, no other sacrifice could compare to his.
SB 9.2.28 — In that sacrifice, King Indra became intoxicated by drinking a large quantity of soma-rasa. The brāhmaṇas received ample contributions, and therefore they were satisfied. For that sacrifice, the various demigods who control the winds offered foodstuffs, and the Viśvedevas were members of the assembly.
Now, another version of story is described in Uttar Kanda of Ramayana. But there are two versions of translation existed. First from here:
Then taking up his bow and arrows, that king of men went out for encounter; but Samavatta stood in the way. And that great sage said unto Marutta words informed with affection If thou hear my speech, thou shouldst not fight. If this Maheshvara sacrifice should remain incomplete, it will burn up thy dynasty.
Where is the fight of one initiated in a sacrifice? And where is the passion of one initiated in a sacrifice ?And victory is ever uncetain ;and the Rakshasa is dificult to vanquish. And thereupon, the lord of Earth Marutta desisted in consonance with the instructions of his spiitual preceptor; and composed addressed himself to completing the sacrifice, giving up his bow with the arrow set. And thereat considering him as defeated, Suka proclaimed this all round; and from delight cried aloud, Victory unto Ravana And then devouring the Maharshis that were present at the place of sacrifice, Ravana, satiated with their blood, again went to the earth.
Second from here:
After having said thus, when Marut got ready to fight, then Samvart Muni said affectionately - "Hey Raajan, You are doing Maheshwar Yagya. It is not proper to fight at this time. Who has been initiated into Yagya, he should not be angry and he should not fight. Besides Raavan is very mighty. It is impossible to win him in war. Obeying Muni, Marut kept his bow and arrow and started doing his Yagya. At that time Shuk said happily - "Raavan has won." So Hey Raam, When Raakshas couldn't quench their thirst with the blood of Rishi present there, they proceeded on their way.
So, now focusing on Ramayana, the story of Samvarta and Marutta is from Satya Yuga which is previous to Treta Yuga in which Sri Rama was born. My taking from this is Samvarta must be still alive because in the Treta Yuga of Sri Rama, Lord Parshuram has met Samvarta after the marriage of Sri Rama. This story is mentioned in Tripura Rahasya.
Hearing on one occasion of the prowess of Rama, his
wrath rekindled and he came back to challenge him. Rama
was born of Dasaratha who, though a Kshattriya, escaped
his doom by a ruse. Rama accepted Parasurama’s challenge
and got the better of him.
Parasurama returned crest-fallen and on his way met
an Avadhuta named Samvarta, the brother of Brihaspati. Later
he encountered Sri Dattatreya who instructed him in the
Truth and so led him to salvation.
1.27. In the past, I did not understand even a little of
what Samvarta told me when I met him on the way.
1.29. But it is not clear to me what Samvarta said in
reply to my query on creation.
2.8. Unexpectedly I met Samvarta, the Lord of the Avadhutas,
and instinctively recognised him to be like fire in embers.
2.13. What Samvarta said is not at all clear to me. I have
learnt the Gospel of Tripura well. It is undoubtedly an incentive to devotion to Her.
2.15. Lord, kindly explain what Samvarta told me before. It is certain that I cannot realise the goal until it is made known to me.
2.18. Later I heard Samvarta say that the fruits of all
these acts are only trivial. I consider those acts of no account
which yield only trifling results.
2.25. I have noticed that Samvarta, the Lord, is quite
happy, being completely free from any sense of obligation
to act and its disastrous results.
3.8-9. Association with the Sages is alone said to lead to
the highest good. Your contact with Samvarta has led you to this stage of enlightenment, which is the forerunner of
emancipation. On being approached, the Sages teach the