Depends on the type of fragmentation and file system. In some file systems types, fragmentation occurs because the OS keeps track of disk memory by splitting it into chunks of X bytes. If a file needs 1.1*X bytes it will be allocated 2 chunks, though it only uses a small portion of the second chunk. This is internal fragmentation, which is hard to avoid.
On the other hand if the file system can allocate chunks of various sizes, then there might come a point where before allocating another chunk the OS has to look for any leftover strips of memory to allocate. External fragmentation is when empty memory is scattered in small chunks throughout the disk, too small to be used - wasted memory.
I think your strategy would correct external fragmentation.