Maybe there's a better way of doing things here.
As long as you provide an example that is not describing your actual code accurately there's nothing we can do.
A good way to avoid loops is using custom entity values which could point to a more specific data point or even an array handle.
Perhaps there's a better way of organizing the data in the arrays to make it more accessable.
Dynamic arrays within dynamic arrays sounds like a stupid idea but can be very clever in some cases.
Tries can be used with "custom pointers" so you don't have to search.
But it all depends on what you're doing.
Also, there's no point of avoiding loops if your action is reacting to, for example, a chat command which is not frequently called.