It removes special html characters from a string and fixes a bug that was causing your hack to always update the database when a moderator replied. See:
www.php.net/htmlspecialchars
Certain functions on the forum require that the text stored in the database be htmlspecialchars()'ed. For an example, create a new thread with a title that has quotation marks in it, reply to that thread with a moderator account, and then attempt to split the thread. Notice what happens to the thread title.
All input should be processed with htmlspecialchars();

The first change in my post above corrrects that. The second change fixes the matching check. The queries add special html tags (like " instead of ") to existing thread titles that may have already been affected by this hack.
After a year of running with this hack, we had approximately 400 out of ~60,000 threads which had the problem. We only realized it when someone tried to split one.