I've read an answer about traveling via a third country in case dual citizenship might not to be OK, and I don't know whether it is technically possible. I'm a citizen of Germany and Saudi Arabia, and I want to travel via UAE. Once I arrive in Saudi Arabia, I'll try to enter with KSA pass but a Saudi official may see from passport that I live in Germany, and in that point is there a risk that he may ask me for German residence permit or stamps or a visa? How can I possibly tackle this situation?
a Saudi official may see from passport that I live in Germany
How would he see that? You're a German citizen, you don't need visas or anything, so there should be nothing in the Saudi passport that links you to Germany.
The main exception here is if you have renewed your Saudi passport in Germany, in which case this may be stated in the passport and lead to questions. This is why it's generally advisable for secret dual citizens to renew their passport in their home country.
Is there a risk that he may ask me for German residence permit or stamps or a visa?
Yes, there is always a risk, since at the end of the day what you're doing is against Saudi law. The risk is low if you arrive via a third country and there's nothing obviously linking you to your second country of citizenship, but Immigration officers can ask anything they like and a question like "Where have you been for the last two years?" can quickly lead you to thin ice.