score:2
First of all, if you are a US citizen, don't worry about visas. You are allowed 90 days of visa free travel to both Japan and South Korea, which is absolutely sufficient for you.
If I am understanding you correctly, your travel route is SFO-NRT/HND(TYO)-ICN/GMP(SEL)-NRT/HND-SFO. You will transit via Tokyo from Seoul to San Francisco.
Not all transits through Japan require transit visas. If you are staying airside for the transit, you don't need a transit visa. If you either:
then you will need to apply for a transit visa. When you leave Japan for Seoul, you have ended your stay in Japan and thus "used up" your single-visit temporary visitor visa.
So you have two (actually three) options: