You get the gist of it very well. A few comments:
An article word (o, os, a, as) used immediately before mesmo: meaning of mesmo is the “same” or “equal”
Yes, not only with articles, but also "este", "aquele", etc. ("this", "that"):
"Li esse mesmo livro ontem." ("I've read this same book yesterday.")
Subject word used immediately before mesmo: meaning of mesmo is “myself” or “itself”
Not always, the real purpose in this case is to give emphasis, so it could also mean, e.g., "certainly":
"Ele mesmo que me bateu." ("He's for sure the guy who beat me up.")
Used as first word of sentence, meaning is “even”
But one could change the order in the sentence:
"Você tem que pagar, mesmo desempregado." ("You have to pay, even being unemployed.")
All other uses the meaning of mesmo is “really”
There are at least another two possible meanings:
- to refer to something mentioned previously:
"Procurei o João, mas o mesmo não se encontrava." ("I looked for João, but he wasn't there.")
- especially in the expression "mesmo assim": "anyway", "regardless", "in spite of this":
"Ela estava ferida, mas terminou a corrida mesmo assim." ("She was injured, but finished the race anyway.")
"Mesmo ferida, terminou a corrida." ("Despite being injured she finished the race.")