There's really no way to prevent dependence to opiates as long as you're using them.
Take them as prescribed. Taking a break every once in a while works. There's anecdotal evidence suggesting that therapeutic doses of Dextromethorphan taken along with your opiate prevents tolerance and therefore dependence. It's OTC(cough syrup) and it would also potentiate the Codeine by providing sedation. I understand some of the things I listed are kind of useless when you're in the middle of what you're going through, though.
Gabapentin withdrawal is hell, and I'd rather withdraw from opiates than any gaba acting drugs.
I don't know what your supply is like, but I'd probably increase the dosage to get the desired effect while you're going through the worst of Gabapentin withdrawal. Once you start feeling the WDs let up, I'd start tapering the Codeine to avoid any issues with it.