make it so the horse checks for a onwall when there is no1 on it, and if it thinks its stuck somewhere warp it,
or make it check above , below, left, right, and if all are wall , warp it
also there is a slight onwall bug if u run too fast u can get past single tiles (like those vertical fences)