HubSpot CRM API v3 Pagination with First, Previous, Last

You could store the value of paging.next.after before you execute the next loop. if you need to go back, you would be able to use that stored value.

If you have a strong use case, I would suggest creating an idea and posting the idea link on this thread for anyone else looking for this functionality to upvote it.