Hi there, I’m glad to announce that I’ve created a plug-in for GIMP that surely you will find useful. It flattens layer groups automatically. Also, it lets you decide whether you want the result on a new image or use the current one. It also has an option to autocrop the resulting layers.
Here you can download it: https://github.com/lordscales91/layer_groups_flatten_plugin