There is nothing wrong with the exported file, there are so much different conversations around (left/right handed, column/major, ...) - you almost always need to change something when importing data. First thing i would try is to negate the orientation z axis (because it's usually the axis with the least mattering human perception).
Changing scale seems more risky - it depends on how scale is used. There are two ways:
* Storing all TRS in one matrix, resulting in skewed hirarchies when there is nonuniform scale.
(You usually don't want this, because there are no more orthonormal orientations, so you can't convert to quaternions.)
* Storing scale in a seperate matrix: Transform hirarchy nodes first by T+R, keep that and store a additional matrix with scale applied. So in the end scale affects only the position of child nodes, but does not skew their orientations. Downside is that scale can only be applied to the nodes local axis (accept you have another rotation that defines the scales orientation).
This can become confusing. I'd start with a scene without any scale, and after you can reproduce that exactly go on with scale.
That's the reason why i say leave scale alone.
Note that the axis negation can fix quat<->matrix conversations, but quats end up to have another handness (mirrored), which is another source of future confusion.
It's best to fix all this when importing data, even if engine data does not match editor data this way.
To be nit-picking, you should write 'float cosAngle = tsz*sz;', because dot product does not give angle, but its cosine. This confuses other people reading your code ;)