You are right in all cases! If I say:
Why do you think I did that?
Depending on tone and context, it can mean:
1. What do you think my reason was for doing that?
2. Why do you think that I am the person who did that?
When spoken, if I said (with asterisks meaning emphasis):
*Why* do you think I did that?
It would mean the first, whereas if I said:
Why do you think *I* did that?
It would mean the second. When written, you would need to rely on the context of the surrounding narrative / dialogue / etc. to help you determine which one was intended. It should usually be clear, if the author has done his or her job correctly, which one he or she meant!
English has many, many ambiguities and strange things. I think it is a very illogical language in many ways and I'm glad it is my first language, so I don't have to ever go through the hassle of learning it as a second language! Think of the sentences:
1. I'm going to sleep.
Does it mean: "I'm trying to fall asleep right now," or does it mean, "In the future, I will attempt to sleep."
2. They are hunting dogs.
Are "they" currently in the act of hunting for dogs, or is the sentence talking about dogs that are used for hunting?