Yes, you can use something like the above to compress your NSP files. However, this is only good for compressing the NSP files themselves. Once you install a game using the NSP file, it will be decompressed during the installation process. In other words, there is no space gain on the Switch itself when the game is installed.