I made a couple of changes to your modded script after running it through a few more times.
I used your threshold-alpha filter on the building level to remove all of the buldings that were underneath the roads. With the feathered selection you used for the roads, there ended up being too many shadows. Running the threshold-alpha filter with a value of 200 on the town layer got rid of the buildings under the roads, which eliminated any extra shadows. The method you used to generate the shadows is still in place, though.
I also changed the script so that the random maps no longer have to be square. The maps can be anywhere from 300 to 3000 pixels in either dimension.
Your additions were noted in the comments in the script. Credit is given where credit is due!!
I attached a zip containing the new script, as well as a picture of what my run looked like with the default values. This was a great tutorial to code up, and now I know how to bevel stuff!