I've not done this, so this is a theoretical.
If you can pass key elements of the datatable to the Run Javascript as an array, looping through 13,000 rows in a javascript array - even with evaluation - is fast.
In Javascript, you would create an array for each element (evaluated information) you needed to act on and return those to PowerAutomate. Then you would just act on those..
Again, I would have to play with how the data moves from PAD to Javascript and back.
I may play with that next week as I could see a use for it in the future.
Another question: The query you are returning... where is that coming from?
If it is something like SQL, can you create queries that return just the data that meets the various criteria you are checking for. It would reduce what you need to act upon.