What this probably requires is state-tracking. What this means is that you need to keep a record of which of the elements was last scrolled to, so you know which one is next in the list.
You'll need at least two things to make this work:
- An array variable which contains references to the elements on the screen which had matched text
- A number variable which keeps track of which element was last scrolled into view
Using the above you can build your array variable up each time the search runs, and then when the first element is scrolled into view you can set your number variable to 0 (indicating that the first element was scrolled to)
When the next button is clicked, you know you can increment your number variable, get the element from the array variable, and scroll that into view. Make sure to check that the number variable does not exceed or equal the length of the array otherwise you'll get errors. Also make sure to reset both the array and the number variables when a new search is run, otherwise you'll end up cycling through the same elements all over again!