This is an interesting question to consider. First of all I'd say there is no such "rule". When ever we try to apply hard and fast rules like that that automate our movements a counter example will pop up where it does more harm than good. A steady alternation might make sense in measure one if you can get used to it but on the other hand since you are playing a double on the down beat, i.e. bass note and first beat of the triplet it will feel more natural to reset the right hand to play the down beat as t + m.
The real issues are (1) how fast do you want to play this, and (2) what is the point of the exercise (assuming that it is an exercise). If the tempo is medium you won't have trouble with (mim) (mim) etc.
However, I am not sure your assumptions about the last measure hold. Since you are moving to another string group do you really want to try and keep mim going? It would seem that you might want to plant your right hand fingers as follows i on D, m on G and a on B. This would allow you to get the last pattern as ama.
This brings me to another "rule" which might be one finger one string. Again, none of these rules are hard and fast and should be taken as possible choices based on speed, tone, and ease of play.