Charles Yeager (yeagerfilm.com) shows us how to stabilize 360 footage in After Effects using "SkyBox Composer", a module in SkyBox Studio V2.
When you use the AE 3D Camera Tracker, you also get Orientation info on the X,Y & Z Axis. SkyBox Composer can use this information to stabilize your 360 footage. This process is done with a couple of clicks as demonstrated by Charles Yeager in this tutorial on 360 Stabilization.
Once you have stabilized your footage you can easily straighten the horizon with the SkyBox Master Camera Z rotation Controls.
SkyBox Studio V2 is a set of 360/VR production tools for Adobe After Effects.
Download a free demo and try it out: mettle.com/free-demo
360/VR + 3D Plugins for Adobe Software