wouldnt a combo of :
// set x, y, z rotation of object
dbRotateObject( int iObject, float fX, float fY, float fZ )
// set X, Y, Z angles of object
dbXRotateObject ( int iObject, float fX )
dbYRotateObject ( int iObject, float fY )
dbZRotateObject ( int iObject, float fZ )
// tells object which axis to rotate around first while rotating
dbSetObjectRotationXYZ ( int iObject )
dbSetObjectRotationZYX ( int iObject )
dbRollObject
dbPitchObject
dbTurnObject
commands might help aswell as they allow free rotation independantly of any axis rotation, ie, free movement
Lastly, if you are getting stuck in an infinite loop because of floating point inprescision, I would suggest looking at another way of performing your iteration that doesnt rely on its condition being a floating point that can become imprescise.
If it ain't broke.... DONT FIX IT !!!