Add an onload handler to your iframe. It will be called after the server responds to the request.
For example:
var uploadFrame = document.getElementsByName('upload_frame')[0];
function handleResponseReceived() {
console.log('this should be called when the form finishes upload and respone is committed');
}
if (uploadFrame.addEventListener) {
uploadFrame.addEventListener('load', handleResponseReceived, false);
}
else {
uploadFrame.attachEvent('onload', handleResponseReceived);
}