This repository demonstrates a bug in Blockly:
connection rules (setPreviousStatement and setNextStatement) are not honoured when a block is inserted into an already existing sequence of blocks.
Please open index.html in your browser to perform the test - in only involves a few guided drag-n-drops.