How can I modify this to create a subdirectory with unique value name and then write the shapefile to it?
You can create new directories with the os module mkdir function. I would recommend using that along with os.path.join to write the output file name for your shapefile
os.mkdir()
https://docs.python.org/2/library/os.html#os.mkdir
os.path.join()
https://docs.python.org/2/library/os.path.html#os.path.isfile