He though thoroughly and pondered upon the matter and then arranged and managed a speech in his heart. That is because when Allah (swt) revealed to the Prophet (saws) His saying:
حم (1) تَنزِيلُ الْكِتَابِ مِنَ اللَّهِ الْعَزِيزِ الْعَلِيمِ (2) غَافِرِ الذَّنبِ وَقَابِلِ التَّوْبِ شَدِيدِ الْعِقَابِ ذِي الطَّوْلِ ۖ لَا إِلَٰهَ إِلَّا هُوَ ۖ إِلَيْهِ الْمَصِيرُ
(Ha, Meem (1) The revelation of the Book is from Allah, the Exalted in Might, the Knowing (2) The forgiver of sin, acceptor of repentance, severe in punishment, owner of abundance. There is no deity except Him; to Him is the destination.) (Ghafir: 1-3)
The Prophet (saws) stood to pray in the mosque and Al-Walid bin al-Mughira was close to him listening to his recitation. The Prophet (saws) knew that Al-Walid was listening to him so he repeated these verses. Then, Al-Walid directly went to the gathering of his people of bani Makhzoom and said to them:
“By Allah! I have heard such a speech from him as can neither be the speech of a mortal, nor of Jinn. It has sweetness and elegance. Its upper part is fruit-bearing, and its lower part causes water to flow. Its beauty, no doubt, surpasses the beauty of all speeches, and cannot be superseded. It is not the speech of any human being.”
After he went to his home, the people of Quraysh got angry and said: “By Allah Al-Walid has converted to Islam”. So, he went to their gathering and said: “You claim that Muhammad is insane, did you ever see him perform any act of insanity? They said: “Never, by God”, so he said: “You claim that Muhammad is a soothsayer. Did you hear him speak like a soothsayer? They said: “Never, by God”. So he said: “You say that he is a poet. Did you hear him recite poetry? They said: “Never, by God”. Walid added: ‘You say that he is a liar. Did you ever heard him telling a lie? They said: “Never, by God”. Thereupon, Quraysh asked Al-Walid: “What we should say about him?” Al-Walid pondered very carefully. Hence, these verses describe him:
إِنَّهُ فَكَّرَ وَقَدَّرَ (18) فَقُتِلَ كَيْفَ قَدَّرَ ثُمَّ قُتِلَ كَيْفَ قَدَّرَ (20) ثُمَّ نَظَرَ (21) ثُمَّ عَبَسَ وَبَسَرَ
(Indeed, he thought and deliberated (18) So may he be destroyed [for] how he deliberated (19) Then may he be destroyed [for] how he deliberated (20) Then he considered [again] (21) Then he frowned and scowled;) (Al-Muddaththir: 18-22)
Their allegations that the Prophet (saws) is insane, a soothsayer, a poet or a liar have been proved to be fabrication. So he thought about the Quran and planned what to say about the Prophet (saws).