There is really no concept of “further down” in the AIML interpreter (except in one case which I’ll explain below). The bot looks at the totality of patterns and finds the best match.
The precedence of one pattern over another has to do with how closely it matches the input, and what types of wildcards it uses:
WHO IS THE PRESIDENT #
WHO IS THE PRESIDENT OF THE USA
Given the input “Who is the president of the USA?”, both of these patterns are potential matches. The bot decides which one to use based on precedence. The # wildcard takes precedence over an exact match, so the bot would pick the first pattern rather than the second. The order in which these patterns appear in the file/bot are irrelevant here.
In other words, the bot will examine all patterns that could match the input before picking the one that matches best.
ONE CASE WHERE ORDER DOES MATTER:
The only time that the order of categories in your files/bot matters is when you have two patterns that are exactly the same. The bot decides which to use based on the order in which the categories were uploaded to the bot. To avoid having to debug, make sure that all your patterns are unique.