I will help if I can. I'm not sure what the issue is. I just want to have another column in the dump that specifies the ISO-3166-2 code if it exists. Maybe it can be put into the admin1CodesASCII.txt or even a new dump file?
If you know some better data sources let me know. I've included a rapidly strewn together script that I used to generate this data. The CDH data referenced can be found online (not sure what the legality of me including it in the file would be).
The attached file contains "results.txt" which has the cross references between country, and administrative region 1 fips code, and administrative region 1 iso code. It's tab delimited so it should be easy to blow apart with your favorite scripting language to generate the sql required. I'd probably just create a nested associative array(PHP)/dictionary(Python) and use them to look up the iso code from the 2 letter country codes / fips codes we already have.