After several hours of distracting myself with ChatGPT. I ended up with this script. This script will use gifsicle to compress gifs the way I need it to. You can type or drag and drop the gif into the terminal and then use default lossy/color depth settings or enter your own.