Hi Mario,
For this type of calculation you really have to hold Mathematica's hand and tell it how to achieve what you want.
Perhaps there is a more clever way, but here is my idea:
I believe the strategy is as follows:
1. Move all CD's which you *know* don't participate in a Box to the left (this is obviously {-a,-a1,-a10,-b1} )
2. Every time derivatives are commuted, only keep R and R^2 terms, dropping R^3 and higher. This can easily be accomplished by introducing a formal order counting parameter and setting it to 1 after every step.
3. Now move all CDs which you know participate in a box to the right and form boxes.
4. Again after every commutation, do as in step 2.
I'm attaching an example notebook which shows how to do steps 1 and 2 in a pretty automatic fashion.
The trick is to use FixedPoint instead of ReplaceRepeated, and after every single replacement,
1. replace all linear curvature operators R with epsilon*R
2. use Series to keep only up to R^2,
3. Replace epsilon with 1.
You should be able to see how to rewrite my original code for SortCovDsToBox (now in xTras) so that it uses the above strategy of using FixedPoint and afterwards applying a function to simplify some things.
There is probably lots of room for improvement in the attached notebook. For example, the postFunction could include other simplifying steps, such as using ToCanonical (though make sure ChangeCovD is off!) and applying various well-known differential curvature identities.
Best
Leo