The script seems to depend on a fixed width/height for the canvas, and it uses whatever size the canvas is when it first loads (it should work for any size you set on the canvas style from what I can see, as long as that style is applied before the script is loaded) - when you draw, you're basically mapping pixels into a pixel grid thats the size of the canvas so it would not be possible to make it dynamically resize without VAST rewrites to the code to resize your drawing (or at least without making the canvas reset each time its resized)
I'd suggest the best solution would be to simply pick a fixed size and work around that. You could do some trickery to make the canvas zoom by modifying its scale transform in relation to your overall page width, but that might require scripting too and could be pretty complex to figure out as well! You could also put the drawbox in an overflowing iframe, but that might be weird!