South Korea's main opposition leader has vowed to appeal after a court handed him a suspended prison sentence for violating election law.