That being said you made a great and valid argument.
He still remains #2 as worst Presidents in my book, but by the smallest of margins imaginable. Had he been reelected he may have indeed succeeded in garnering the #1 spot.
Carter tried his hardest to not allow the Shah to come to the US for medical treatment. President Nixon probably had a lot to do with convincing Carter to let him come.
Nevertheless, the Shah wasn't allowed to stay in America and probably would have turned him over during the Hostage Crisis.