I think you were pretty close on your attempt to bottle carbonated beer. Couple of things could help: I spray sanitize my bottles, then put them in the freezer for 15+ min. The colder the bottle, the less tendency for C02 to come out of solution. Add a small #2 stopper to your cobra tap / racking cane (and make sure the out end of the tube has an angle so you can't block it at the bottom of the bottle). Drop the keg pressure temporarily, as you did, right before bottling. Then as you fill each bottle, try and keep pressure in the bottle by allowing a small amount of gas flow (slow hiss) past the stopper. Sounds tricky, but pretty easy after 1 or 2 tries. The pressure in the bottle keeps the carbonation in the beer. I quickly cap as the foam starts as I remove the tube/stopper. This is my workaround to mimic a bottling gun - I don't do it enough to justify the expense.
Oh, and make sure to purge the bottles with C02 as you pull each one from the freezer right before filling.