Exporting and re-importing the WSL distro is simpler and usually preferred. The tutorial and script are based on this conversation: https://superuser.com/questions/1606213/how-do-i-get-back-un... which mentions some issues with the re-import that includes the need to reset the default username.
Looking at the source, it seems to use a `wsl --export` option rather than `diskpart`.