The iOS 7.1 SDK isn't available anymore in the current version of Xcode, so the script doesn't work without modification.
By setting IOS_SDK_VERSION to an empty value, the script will default to a symlink* which always points to the latest installed SDK.
* /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk