Yeah, I understand - and I really don't want to annoy you with this probably-often-discussed topic.
But wouldn't it be possible to implement it like WordPress does? And you could implement code that could check for identical names of categories/threads and then just add a $CATEGORYNAME-1, then $CATEGORYNAME-2 and so on if the name already exists?