There's a file uploaded here on BGG for a "random tile generator" that should solve your problems nicely.
If it's the file I'm thinking about, I looked at that soon after it was created. There are a lot of nice ideas in there, but I didn't see any scaling of difficulty and it was way to cumbersome. I don't want to be rolling 20 times to set up every tile. :/
Maybe it has changed some? I'll check later on today.