I know there is a way to use the built in zip function of byond already, of which I happened to lose during my last reformat. I do hope I got it backed up some ware. But anyway my suggestion is to create a pack & unpack proc instead of the soft coded version.
Pack(data) or zip() - Compresses using the zip format
Unpack(data) or unzip() - Decompress the data from the zip format
This can be useful for compressing data going to another server via world/topic, Or in compressing save files. Of course there are many other uses for such a proc, Such as compressing data on the byond host server for Linux.