Once you've rotated the shadow to the same as the mesh just use a single align to vector on the y axis but not on -ve normals.
By using both x and z axis' you're effectively re-doing the rotateentity.
AlignToVector shadow, PickedNX#(), PickedNY#(),PickedNZ#(),2,1
By using both x and z axis' you're effectively re-doing the rotateentity.