Thomas William Rhys Davids in his Buddhist India (p. 188) has given a chronological table of Buddhist literature from the time of the Buddha to the time of Ashoka which is as follows:
1. The simple statements of Buddhist doctrine now found, in identical words, in paragraphs or verses recurring in all the books.
2. Episodes found, in identical words, in two or more of the existing books.
3. The Silas, the Parayana, the Octades, the Patimokkha.
4. The Digha, Majjhima, Anguttara, and Samyutta Nikayas.
5. The Sutta Nipata, the Thera and Theri Gathas, the Udanas, and the Khuddaka Patha
6. The Sutta Vibhanga, and Khandhkas.
7. The Jatakas and the Dhammapadas.
8. The Niddesa, the Itivuttakas and the Patisambbhida.
9. The Peta and Vimana-Vatthus, the Apadana, the Cariya-Pitaka, and the Buddhavamsa.
10. The Abhidhamma books; the last of which is the Katha-Vatthu, and the earliest probably the Puggala-Pannatti.
The 500 years quote I think is in the SV, #6 above and the 5,000 year quote is in the commentaries, #11 above (if there was a #11).
The higher up on the list, the older the text and probably more likely to be authentic, in my opinion. I'm not saying that #6 to 10 are not authentic, but I prefer to focus on the earliest of texts, found in the Nikayas and the Patimokkha-part of the Vinaya.