I've implemented the local storage solution mentioned in the docs. I save the configuration using this:
xml = Blockly.Xml.workspaceToDom(workspace);
xml_text = Blockly.Xml.domToText(xml);
localStorage.setItem("blockly", xml_text);
and, when loading the page, retrieve it via
xml_text = localStorage.getItem("blockly");
if (xml_text) {
xml = Blockly.Xml.textToDom(xml_text);
Blockly.Xml.domToWorkspace(.workspace, xml);
}
You could use a similar approach:
first, create a "test" version of your workspace,
with the desired block in it.
Then, use an approach similar to the above to create a string like xml_text above and
copy that string (perhaps to the developer console).
Then hard-code that string in your program as part of the initialization of the workspace.
For example, here's the xml_text currently saved in my localStorage after I inserted a single block in my workspace:
André