This こと simply means "(intangible) thing". More simplerSimpler examples are:
- 悲しいこと sad thing / something sad
- 嬉しいこと happy thing / something happy
- 簡単なこと easy thing / something easy
Likewise, 訳の分からないこと means "nonsensical/unreasonable thing", which is the object of the verb 言う.
In case you don't know what this 訳の is doing, you have to analyze this part as a relative clause. Actually, 訳の分からない is a relative clause modifying こと. So the very literal translation is:
訳の分からないこと = 訳が分からないこと
thing in which reason/logic is not understandable
→ unreasonable/nonsensical thing
This combination appears very often and you may practically think 訳が分からない or 訳の分からない is almost like a single-word i-adjective, as I explained before. Also note that ga-no conversion may happen. More simplerSimpler examples of this pattern are:
- 心の狭い人 a narrow-minded person
- カバーが赤い本 a book with a red cover
- 桜の有名な公園 a park that is famous for cherry blossoms
By the way, I feel you're asking about almost every single sentence in this scene over several months, and you've asked about the exact same sentence four months ago. This time, こと is one of the most basic words of Japanese. Are you sure you're reading material suitable for your level?