How do I programmatically and reliably get the AirPort's interface name? I need the en0, en1, enN, enWhatever name of my Airport in a script.

How do I get it reliably?

Here is what I put together, but it looks ugly and brittle as it's "text parsing":

airport_hardware_name='Hardware Port: Wi-Fi'
networksetup -listallhardwareports | awk -v p="$airport_hardware_name" '$0 ~ p { getline; print $2; }'
If you need to support old versions of OS X, the Wi-Fi network service was called Airport in 10.6 and earlier.

networksetup -listallhardwareports | awk '/^Hardware Port: (Wi-Fi|AirPort)$/{getline;print $2}'

You could also use -listnetworkserviceorder:

networksetup -listnetworkserviceorder | sed -En 's/^\(Hardware Port: (Wi-Fi|AirPort), Device: (en.)\)$/\2/p'

Or read /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist:

ruby -e 'require "plist";puts Plist::parse_xml("/Library/Preferences/SystemConfiguration/NetworkInterfaces.plist")["Interfaces"].select{|i|i["SCNetworkInterfaceType"]=="IEEE80211"}[0]["BSD Name"]'