In the report of Ḥassān there is a clear proof that reciting good poetry in the mosque is permissible. Al-Nasāʾī even titled a chapter:
“Permission to recite good poetry in the mosque.”
Most scholars have adopted this position.
As for swapping poems back and forth in a competitive manner, that is forbidden, as has already been clarified in al-Manāhī, paragraph (6). Al-Bayhaqī said:
“We see no objection to reciting verses like those Ḥassān composed in defense of Islam and its people, whether inside the mosque or elsewhere. The first ḥadith concerns the mutual recital of pre-Islamic poetry and other lines that are unfitting for the mosque. Allah alone grants success.”
13 – Pitching a tent in the mosque for a sick person—or for any genuine need.
ʿĀʾishah (Allah be pleased with her) said: “Saʿd [ibn Muʿādh] was wounded on the Day of the Trench—[a man from Quraysh named Ḥibbān ibn al-ʿArqah shot him] in the median vein of his arm—so the Prophet ﷺ pitched a tent for him in the mosque so that he could visit him at close range. [While a tent belonging to Banū Ghifār also stood in the mosque, they were suddenly alarmed to see blood flowing toward them. They cried out, ‘People of the tent, what is this coming from your side?’ and found that Saʿd’s wound was gushing blood, and he died of it.]”
The ḥadith is recorded by al-Bukhārī—with this wording—and by Muslim, Abū Dāwūd, al-Nasāʾī, and Aḥmad through the chain of Hishām from his father, from her. The second additional passage is also in Aḥmad’s version, and likewise.