From my study I have come to the conclusion that Elijah wrote the "writing" before he was taken to heaven. It seems pretty clear that by "the prophet Elijah" the writer of Chronicles is not referring to a different Elijah.
The Hebrew word miktab (translated "a writing") is also used in 2 Chron. 35:4 which says:
And prepare yourselves by the houses of your fathers, after your
courses, according to the writing of David king of Israel, and
according to the writing of Solomon his son.
No one assumes these verses are saying that David and Solomon wrote their "writing" during the time of 2 Chron. 35 so there should be no reason to assume that Elijah was on earth at the time the writing came to King Jehoram.
As a prophet Elijah be able to prophesy of things that had not happened. He told Ahab it wouldn't rain for 3 1/2 years.
Elijah received similar messages from God about the sons of Ahab (one of whom was also named Jehoram):
And the word of the LORD came to Elijah the Tishbite, saying, Seest
thou how Ahab humbleth himself before me? because he humbleth himself
before me, I will not bring the evil in his days: but in his son's
days will I bring the evil upon his house. 1Kgs 21:28-29
Also Elijah's messages were brought out another time after he was taken to heaven:
Wherefore they came again, and told him. And he said, This is the word
of the LORD, which he spake by his servant Elijah the Tishbite,
saying, In the portion of Jezreel shall dogs eat the flesh of Jezebel:
And the carcase of Jezebel shall be as dung upon the face of the field
in the portion of Jezreel; so that they shall not say, This is
Jezebel. 2Kgs 9:36-37
So why couldn't he have written a message to Jehoram before he was taken to heaven? Elisha or someone else might have delivered the "writing" at the right time.
Barnes and Wesley say that 2 Kings 2 (Elijah's ascension to heaven) was not in chronological order with the rest the account but it seems more likely that he wrote it before his translation.
As to the question of whether Elijah was actually transported to heaven or just through the atmosphere to another place: God's chariot is in the clouds and the wind (Ps. 104:3) and His angels are a flaming fire. These are the same terms mentioned in the Elijah story. If we let the Bible interpret itself it would appear that God sent His own chariot (or likely even came down Himself) to get His prophet. Isaiah 66:15 also refers to God's chariots like a whirlwind "when He comes."
There is an account in the Bible where someone was transported only horizontally. Philip was "caught away" to another city (Acts 8:39-40) but no chariot, no whirlwind, no expectation of something great happening.
It is pretty obvious from the text that this was an unprecedented occasion. It says twice that Elijah was taken "up" to heaven. Up is vertical. There is no reason for a whole chapter if he was only transported to another place. And while the sons of the prophets went looking they didn't find him, as Elisha said they wouldn't.