The Talmud at Bava Basra 14b-15b teaches that Moses wrote the Book of Job before the Exodus. If so, was he a contemporary and a witness to Job's suffering, was he describing a historical figure he didn't know, or was it simply an inspirational fable?
There are many different opinions regarding when Iyov existed, if at all. Many are mentioned in the Talmud you cited in your question.
The Talmud (Sotah 35A) brings an opinion that Iyov died shortly before the spied entered the land, a little more than a year after the Jews left Egypt.
The Talmud (Babba Batra 15A) (translation here) says that Moshe told the spies to see if Iyov was in the land.
The Talmud there also brings an opinion that 'The span of Job's life was from the time that Israel entered Egypt till they left it.'
According to Iyov 42:16, Iyov lived 140 years after his suffering. Since Moshe was only 80 at the time of the Exodus, he would not have seen Iyov's suffering.
The following possibilities are mentioned in the Talmud in Bava Batra 15a-15b for when Job lived. Some of them are derived from Scriptural verses, and some of them are questioned. (All translations from Soncino).
- איוב בימי משה היה — Job was contemporary with Moses
- ואימא בימי יצחק — I might say that he was contemporary with Isaac
- ואימא בימי יעקב — Or I might say that he was contemporary with Jacob
- ואימא בימי יוסף — or with Joseph
- איוב בימי מרגלים היה — Job was in the time of the spies
- איוב לא היה ולא נברא אלא משל היה — Job never was and never existed, but is only a typical figure
- איוב מעולי גולה היה — Job was among those who returned from the [Babylonian] Exile,
- ימי שנותיו של איוב משעה שנכנסו ישראל למצרים ועד שיצאו — The span of Job's life was from the time that Israel entered Egypt till they left it
- איוב בימי שפוט השופטים היה — Job was in the days ‘of the judging of the judges’
- איוב בימי אחשורוש היה — Job was in the time of Ahasuerus
- ואימא בימי דוד — But perhaps he was in the time of David
- איוב בימי מלכות שבא היה — Job was in the time of the kingdom of Sheba
- איוב בימי כשדים היה — he was in the time of the Chaldeans
- איוב בימי יעקב היה — Job lived in the time of Jacob
Maimonides in Guide for the Perplexed 3:22 assumes that Job never existed, in part because of the so many differing opinions as to when he lived:
THE strange and wonderful Book of Job treats of the same subject as we are discussing; its basis is a fiction, conceived for the purpose of explaining the different opinions which people hold on Divine Providence. You know that some of our Sages clearly stated Job has never existed, and has never been created, and that he is a poetic fiction. Those who assume that he has existed, and that the book is historical, are unable to determine when and where Job lived. Some of our Sages say that he lived in the days of the Patriarchs; others hold that he was a contemporary of Moses; others place him in the days of David, and again others believe that he was one of those who returned from the Babylonian exile. This difference of opinion supports the assumption that he has never existed in reality. But whether he has existed or not, that which is related of him is an experience of frequent occurrence, is a source of perplexity to all thinkers, and has suggested the above-mentioned opinions on God's Omniscience and Providence. (Friedlander translation)
Interestingly, R. Joseph Ibn Kaspi (who is usually the one that gets accused of being radical) in the beginning of his explanation of the Book of Job takes strong issue with the position that Job never existed. He writes that such an idea basically destroys the entire Torah. If we can say that a Sciptural book which says "there was a man in the land of Utz" is really just an allegory, then what stops us from saying that about other Scriptural books? Perhaps the books of Samuel, Ruth, and Esther are only allegories? Perhaps the story of Noah and the ark and the flood is just an allegory? Following this approach we have no Torah or Scripture.
Ibn Kaspi says that if he wanted to he could explain the Book of Esther allegorically. Ahasuerus represents God, Haman represents Satan, etc. But heaven forfend to allegorize Scripture like this, except in instances where philosophical principles demand it.
Therefore, concludes Ibn Kaspi, Job certainly existed, and if the ancient authorities couldn't figure out when he lived — who cares?!
Basically there are multiple valid opinions.
Various midrashim put him roughly around the same period as Moshe (though Sforno reads that "Utz", a nephew of Avraham's, is in fact "the man from the land of Utz" i.e. Iyov). There's another opinion that the story is in fact fiction, "Iyov never existed and never was created."