I wonder if you could do this with DS_Store files (not the emulating MacOS, but just the game of life thing), so initially you make some new folders in a pattern, right click, align. (So it's all on a grid)
Then run the script, it reads the position of folders from the DS_Store file, updates it with the new positions of the next frame of folders, or creates/delete folders if needed.
Then run the script, it reads the position of folders from the DS_Store file, updates it with the new positions of the next frame of folders, or creates/delete folders if needed.