Hi, I appreciate the effort you have put in writing this post. There is a similar functionality already available in various touch screen devices like iPad, Galaxy Note etc.
When you open the paint application in iPad, and you start drawing the rectangles / circles / lines, the interface automatically converts it into the actual objects. Similarly, the freehand texts you write on the screen are converted into actual text contents.
So, your concept can be an extension to such tools / application wherein the application understands various WEB objects and generates the code accordingly.
Again, this is just a thought from my side.