First, when an answer gets hidden, it loses its "best answer" status. So if it was a best answer before hiding, then the asker loses 2 points, and the answerer loses 20 points.
For the first part of your question, the asker would get 2 points for selecting an answer, lose 2 points for hiding the selected answer, get 2 points for selecting the other answer, and have a net gain of 2 points. The first answerer would get nothing because his/her/their/its answer got hidden, and the second answerer would get 20 points for having his/her/their/its answer selected.
The second part of your question is the same as the first, except both answers are posted by the same person. The asker still gets 2 points because nothing changed for him/her/them/it, and the answerer gets 20 points because 0 + 20 = 20.
source: tested on Pokebase