Thanks pixelglow for taking a look at the Lekh Diagram.
For me, writing the shape recognizer did not take much time. But designing/thinking the overall app usability took much more time.
It looks like your shape recognition is handled differently from Instaviz. Yours is more oriented toward general purpose drawing, whereas Instaviz is more tuned toward recognizing specific shapes.
Yes, the Lekh Diagram first recognizes a general shape which is matching to user's drawing then uses various heuristics to convert it to regular shapes like rectangle, parallelogram etc.
There is setting that switches of most of second step (regularizing shapes). In the Misc->Settings, there is "regularize shape" switch