I deal with this often.
I don't really like using the "running pattern" approach, trying to make 3 corners match and then whatever on the fourth.
On larger patterns, it will leave the pattern off center on at least 3 of the sides and a mismatched fourth corner and to me, it just doesn't look right.
Usually we have to deal with an existing size and we can't alter the size to fit the pattern.
Some patterns might be exact mirror images and other ones just run to the right or left and there's not much you can do about it.
Another issue is that with some mouldings, Roma and sometimes LJ, you figure the pattern on one leg and cut the next leg and the pattern is a little wider apart or a little closer together.
Also, you may have a double pattern, one large pattern on the outer part and a smaller pattern near the lip, like beads or dashes and dots.
And, they are not necessarily made the same in conjunction with each other...
I will usually start by figuring the OD and I put a tape measure on the moulding to see where I can center the pattern on each leg and I try to hit the pattern with the cut in the least "busy" area.
I might then put a little piece of blue painter's tape to mark on the moulding where I want to cut.
I cut the top leg first about an inch bigger than it needs to be.
Then I see what I need to cut from each end to center the pattern.
Then I cut a side leg a little bigger and cut from each end to center and see how it works with the top leg.
Once I get the top and side figured, I just copy them for the remaining 2 sides (except, as I mentioned, sometimes they fool you and the pattern width varies..
)
I always try to center the top and bottom legs because they are the most apparent when viewing.
When you have a smaller "busy" pattern, it's not that big a deal and not as noticeable if it doesn't match perfectly.
Here's a pretty busy pattern that I worked with.
I centered the turtles on each leg with no "half turtles" in the corners...
Here's a very large pattern where I centered it and then I did a little carving and touch up in the corners to blend the pattern...
All that said, there really is no exact formula, it's just using your eyes to get the best result.