Have you tried running the equivalent ExtendScript code in the ExtendScript toolkit?
In general this is a good tactic for working out whether this is a problem in CS SDK's libraries, or a general scripting problem.
I did it and in ESTK everything works fine.
Even with a simple alert() as a JS string I get errors in AS3...
The workaround I've found is to bounce from AS3 to JS to AS3.
My AS3 function calls a JS function within an embedded jsx (like in Zak's cookbook); this one contains a suspendHistory() method which in turn, calls another function back in the AS3 code.
Not ideal, but doable.
David, should I add the suspendHistory bug in the "CS SDK bugs" topic?
No need to post to the separate thread Davide, I've already filed a bug about this.