I don't know if you want to set limits. You might let him know that there are certain behaviors of his that you cannot tolerate anymore, define them, and that you will not spend time with him, unless he gets some help.
You could let him know you are going to leave, or ask him to leave, when you are not willing to be around him.
Otherwise, perhaps not giving him feedback except that he clearly needs professional help, the broken record routine. Only talk when it is about something positive, a common interest, or an activity. Stop trying to help. Let him know you can't.