The first thing is to buy used from reputable sellers. Many Buy and Sell forums have a feedback system which allows you to make an informed decision.
The next step is to do your homework. Used lens hold their value, unless badly mistreated, or made obsolete (in some cases this can increase the value). If the lens is way off what you find on B&S Forums or ebay prices, then it's either stolen, or problematic.
Fungus is a huge no-no, and I prefer my lenses to come from smoke free homes (hard to verify).
Dust inside the element is okay, but front element scratches (while not likely to cause light-path issues) is a sign of a mistreated lens, and I would immediately walk away from purchasing, unless sold at a considerable discount.
Check the focus rings for smooth motion. There shouldn't be any grinding, or grit. Push-pull zooms, and non-constant length zooms may have some barrel creep, but if it slides too quickly with no force, I would consider not purchasing.
Minor focus issues can be corrected with a trip to Canon Service, and even with the service fee, you may be left with a better deal than had you purchased a 9+ lens.
Ensure the lens caps still fit snug, and the mount ring is clean. If you can mount the lens, and ensure the AF communication works (as well trying out focusing).
As I stated, buying from a reputable reseller will mean that you have a good recourse should something not be to your liking.