I am not one of the Blockly professionals, but I give it a try to answer your question.
To make it work you gotta bind the two functions Neil suggested to e.g. Buttons - just calling them once on an empty workspace will of course have no effect.
Just put them into js functions like
function undoAction(){
Blockly.mainWorkspace.undo(false);
}
function redoAction(){
Blockly.mainWorkspace.undo(true);
}
and then bind these to the onclick-call of e.g. two Buttons defined in your .html file or application. When clicking them the main workspace will now perform the undo/redo actions.
I have to admit that these are somehow misleading as they more look like setters than function calls if one is not that familiar with blockly.
Hope this answer helps to solve your problem!