I don't know if what amount of sugar/carbs will take you out of ketosis, but as you said, what's done is done. Regroup, drink lots of water, and continue on. You only fail if you go back to where you were before starting IP.
It would probably be helpful to figure out why you ate the cookies, in case there's something you can do to avoid eating off OP in the future-- do you need to put the GS cookies out of sight? Did you let yourself get too hungry? Was it an emotional reaction to something else?