There's a relative clause que le médecin vous a données. The antecedent que must be right after the noun it represents (gélules).
The time clause tous les matins can go either before or after the relative clause.
Concerning the agreement of the past participle there are already answers about that you can look at, for instance here. You'll find more by ...
That's correct. "To think about sth" is translated by "penser à qqc". There is a difficulty, though. If you say instead "I'm thinking about it." you do not say (because it's wrong) "Je pense à le."; the equivalent of "about" is, so to speak, absorbed into the pronoun, which is not "le" but "y" and you say "J'y pense.".