I began this project, following @james-srl's advice, to learn JavaScript more fundamentally. I was comfortable with jQuery but needed fundamental knowledge to be able to use other libraries, frameworks and plugins.
I became bored with it once I started to write the AI script; that part is broken and I am probably not going to end up fixing it. If you remove some coordinates from window.blocks, the AI script works fairly well.
This was fun and taught me a lot about performance, intervals, timeouts, and the inconsistencies of precise time measurements in JavaScript.