First, don't use AOE clouds. If you want to optimize the method you are using, use markers. They do not tick and are only referenced when called upon server-side such as with an @e check. If you want to go further, store all blocks that need to be restored in a data array, and iterate through it to restore them.
My personal solution though would be to just have a copy of the map in its state you want to restore, and clone it back in at the end. You can filter a set of blocks for cloning to help improve performance using a block tag defined in your datapack.
Hope this helps!