Can you give us any hint about what isn't valid for m=5 and n=13?
Starting fresh and evaluating your notebook for m=1 and n=1 completes with 17 rules for each of Ao and Bo.
Starting fresh and evaluating your notebook for m=5 and n=13 completes with 17 rules for each of Ao and Bo.
There do not appear to be any warning messages about serious errors.
I am being very polite here. Perhaps this will help you with questions you ask in the future. Imagine someone from the other side of the world walks into your office, dumps 100-200 kbytes of source code on your desk, says "I typed some stuff in, some stuff came out, some stuff is wrong, what is it?" You are probably not going to take their 100-200 kbytes of source, read it all, reverse engineer it until you understand what field they are working in, what problem they are working on, how much they know, how much they don't know, what methods they are using, where they have a small misunderstanding or even a misplaced character, and then point that out to them. Or at least you will not do that very many times, not unless there is some superior/subordinate relationship that demands this or unless there is some expectation that the favor will be repaid in the future when you dump 200 kbytes on their desk.
Can you make the kind of problems that you post repeatedly substantially easier for someone who knows absolutely nothing about what is in your head because you have probably been working on your problem many hours a day perhaps for months or years?
Perhaps that will substantially increase the likelihood that you will get helpful replies and be able to get on with the work you need to do.
Because you seem to repeatedly have problems with not getting the same results from Do[] loops, perhaps Reap and Sow might help you. Here is a small example
In[1]:= Reap[Do[i;i^2;Sow[i+3];i-4,{i,1,6}]][[2,1]]
Out[1]= {4,5,6,7,8,9}
The i;i^2 and i-4 are just examples of intermediate results calculated during your Do, but that you are not interested in, what you want is to see the result of i+3 each time.
Reap "creates a bin" that results will be put into in order by Sow. Sow can put any sorts of results in there. The bin just keeps filling until the Do is finished and then the Reap takes all the results and hands them back to you. You can have multiple Sow inside the Do, each with different expressions that you want to collect for output at the end. That [[2,1]] at the end discards some extra information you probably don't need. But the point is that Reap will collect up all the results from Sow, in order, and give them to you as the result.
Perhaps Reap and Sow will let you use the Do loop you have been using and still get the results that you want.