How can I guide user to the next unread post within category

I’ve found the error in my nested if statements which was causing the infinite redirect loop – I failed to check if we were already on the first post before redirecting to the first post in the category. Duh!? It really had nothing to do with how I was using get_posts or wp_redirect…

Need more coffee >-(

error code: 523