You pick your cubes you want effected, select your texture and run it.
You can chose were the selected islands will end up, how long and wide, the padding amount (can be 0 if you want no padding)
And if you have parts of uv that overlap it will preserve that If you want.
To use the script press "CTRL SHIFT i"
and paste it in their, hit enter
Please test it out. Find any issues with it.
I only tested it in bedrock entity.