@mani1 has covered most of the points and he is spot on. I would just like to add below points:
4) A way to catch a lousy denting/repaint is that the panels dont fit properly. If there is a major repair of doors or fenders usually the fitting is not factory like and the gap between these parts is inconsistent.
5) A freshly painted part will have less webs/ micro scratches compared to other parts. Try to see if you can make out consistent webbing/micro scratches on paints.
6) If a removable body part such as doors, boot or bonnet has been removed and repainted you will notice some scratches or uneven spray around/on the bolts. This might not be applicable in case the repaint has been done without removing the part. In that case its difficult to judge by the bolts.
In my opinion knocking on the part with the tip of your nails is best technique as you can make out the sound of a painted part almost immediately. A painted part would sound thinner and almost echo the sound throughout the part. The painted part usually has a damping effect and almost dabs the sound of your knock immediately.