[TransformSet Gimbal Lock Workaround]
[EDIT: original question deleted]
I have sort of found a solution or workaround to the gimbal lock problem that allows you to circle around the mesh without flipping it using TransformSet. Basically what I do is to switch the Y-axis with the z-axis of the mesh. You can do that by applying a -90 degree X Rotation using the deformation slider(tool->deformation->rotate). You need to do this only ONCE prior to animation.
Then you can undo that transformation by calling TransformSet with an X-rotation of +90. You can freely circle around the mesh now using the Z component of TransformSet instead of the y component. For instance:
[TransformSet, (Document:Width*.5), (Document:Height*.5), 0, 100, 100, 100, 90, 0, 90]
this will rotate your mesh 90 degrees around the y axis without flipping it. Rotation around X axis can also be done you just have to always add 90 degrees to make up for the initial -90 degree deformation rotation.
When you got subtools you need to deform all of them using (tool->deformation->rotate) and then you need to (manually) reposition them again. You only have to do it once though prior to animation.