Lots of people have chosen not to run - but Johnson is the only one I can think of that left during election season. He left the race in MARCH. No one I know of has left the race after actually securing the nomination. Every one else just chose not to do it.
I can think of a few - Polk, who ran for office PROMISING to serve one term, and quite honestly, did more in that term than almost any other President. Coolidge didn't want the job the first time, and famously answered in his typical terse manner "I do not choose to run for President in 1928". I think I read once that he was fishing at the time - and went BACK to fishing after the statement.
Truman didn't run, but having served MOST of FDR's fourth term - it would have been shy of 12 years as President - and he wasn't going to beat Ike. That, plus following the Korean War, he had the lowest approval ratings in history. Remember that he squeaked past Dewey in '48.
Let's think - Buchanan. I've been to his home in Wheatland. Buchanan's administration was filled with scandal - and the nation was heading towards Civil War even before the election. Can't blame him.