My take is ABAB expresses dynamically (表示动态感) or extent in degrees, while AABB is for statically (表示静态感).
For example, 舒服舒服 vs 舒舒服服。
舒服舒服 is kinda like 'Wow, I feel great!', it might imply that you feel that way constantly. For instance, someone is giving you a massage, and you feel great and enjoy it so much, and you would probably say 舒服舒服 to indicate that you are comforted by the massage constantly. You could say 舒服舒服 in a cutie way to express funny as well.
Well, 舒舒服服 describes you are actually in the state of being comfortable (舒服). For instance, 我舒舒服服的躺在沙发上.
There are more examples: 高高兴兴 vs 高兴高兴, 干净干净 vs 干干净净, 漂亮漂亮 vs 漂漂亮亮.
However, not all words can be used as AABB, like 好吃. 好好吃吃 sounds wired, because 好好吃吃 doesn't sound a state of being something. Well, 好吃好吃 makes sense.
It's hard to define a rule that could summarize what kind of words can be used in this pattern. Practically, I think those formal or official words usually can not be used like this. For example, 伟大, 光荣, 勇敢. Maybe it's not good to ruin the integrity of those words? That's why you could not use them like that? I am not quite sure about it indeed. Those 'normal' or more colloquial words usually can work either in the form of AABB/ABAB or both.