This is more or less correct. If you repeat a course, AMCAS doesn't really average the two courses/grades per se (no one is looking at your transcript and saying look, they repeated this course, lets average the grades). When calculating your GPA, AMCAS will use every grade you entered, weighted according to credit value, to calculate your GPA.
[(3*2+4*4+all other credit values*all other grades)/total number of graded credits] ** I know this equation isn't grammatically correct according to mathematical standards. 🙂
This is basically averaging all of your grades together; the same numerical outcome would have been obtained if you took any other 4 credit course and got an A (in lieu of repeating the same course and getting an A).
i.e. (3*2+4*4)/7, this equals ~3.14, right; but when you integrate this grade into your other grades, it is worth 7 credits (sum) at 3.14, not 3.5 credits (average) at 3.14. Isn't math wonderful.