Ad hominem doesn't mean "don't say bad words about me and my opinions". Ad hominem would be disregarding an opinion not by discussing the opinion, but by discarding the opinion based on WHO said it.
It's in fact very hard to commit ad hominem against an anonymous person online who has said nothing about themselves. If they said "I have a history of delusions" and I said "therefore your opinion has no merit", that's ad hominem.
The fact that despite that you constantly hear people complaining about "ad hominem" online is just that much funnier. Strawman is another one that most people love to say, while having no clue what it means.
You called the argument delusional, and therefore it wasn't an ad hominem, so you're right about that.
But, "Delusional" is often associated with name-calling, so it sounds more like you're calling the person delusional, rather than what they said. Something like "This sounds delusional to me" would avoid that confusion.
But even if I decided to call the commenter names, that wouldn't be ad hominem (link above on details).
It's rude, it's uncivilized maybe, we can have qualifications like that. But it's not "ad hominem", because "ad hominem" isn't about "you insulted someone".