Here is a couple articles/tutorials on auto-tiles: here and here

And now an interesting video on some dude making an auto-tile...