I'm a US citizen and got my tourist visa code and visa stamp on my US passport. I will be going to Iran in 2 weeks! I applied through an Iranian tour agency and the Iran Interest Section in DC.
I think whether you want to get your visa in Berlin or in the US depends on when you are going to Germany and when your tour agency can send the visa application. Luckily, you still have time.
Right now, it takes about 10-12 weeks for US citizens to get the visa authorization code (which for me was a 6 digit number). I got mine about 11 weeks after my tour agent sent the application to the MFA in early August. After you get the visa code, you can apply your passport at the Iranian consulate/interest section. For me, it took 1 week to get my passport back from DC. I've heard it takes around 2 weeks on average to get your passport back from DC. When I needed help filling out their visa form, they answered my emails within hours.
Keep in mind of the timing issues. There is a possibility the MFA won't want to give you the visa code until very close to your arrival date. This is what my tour agent hinted at. For example, when I applied in early August, I indicated my arrival date as Nov 2. I got my visa code the week before Nov 2, and got my passport back from DC on Nov 3. That was okay as my plans were flexible.
The visa will last a certain amount of time upon arrival in Iran (21 days for me), the time interval when the visa is actually valid (3 months for me), and the actual valid dates (Nov 2 to Jan 31 for me).
It seems, you should pick Berlin since you'll be there. Consider how long they will stamp your passport and send it back, or if you will pick it up in person. Or if you want to work with the DC interest section, you can let them know that you're flying out soon, and that you need it back quick. Either way, make phone and email contact with these offices to make clear your intentions and expectations.
I think once the MFA gives you a visa code, that's it, the visa stamp is available for you to pick up; it means Iran's MFA allows you to enter. I think the consulate/section's job is to catch discrepancies between your visa form, passport, and the info from the MFA. If they find any, they probably have to call the MFA, call you, reject you, etc.
The MFA has to give the code number to the consulate/section before you send your passport. My travel agent let me know my code #, but I really didn't have any use for it. On the DC visa form, there's not even a place to jot it down. Maybe at other consulates, you have to write it down. Being paranoid, I did attach a sticky note with the code # on my form, but I knew they really didn't need it. I had already emailed the DC section to confirm my code number was for me and my passport #. That was also my way of confirming that my tour agent was legit. I mean, anyone can email you a 6 digit number and ask for $50, right? You should reference your visa code in any correspondence of course.
Let me know if you have any questions!