After I do the scaling, I set the IKBlend and IKSpace values back to what they were originally. The problem is that when I set the IKSpace back in script, the bone seems to go back to it's pre-scaling world-space position.
Now... if, after I've set the IKBlend values back, I MANUALLY change the IKSpace values of each key, there is no problem. To debug this, I've tried sticking a specific key into a variable and looking at the values of all it's member variables. Then, after changing the IKSpace by hand (clicking on the 'Object' radio button, rather than the 'Body' one in the Motion/Key Info/IK section), the only value that has changed is the IKSpace. I figure that something else must be changing as if I only set this value in script I get these problems.
Can anyone help?