Functions:
During ejaculation smooth muscles in the walls of the vas deferens contracts and propell sperms forward, this is also known as peristalsis. The sperm is transferred from vas deferens into the urethra, collecting secretions from the male accessory glands, seminal vesicles, prostate gland and bulbourethral glands, which forms the bulk of the semen.
Diseases:
The common vas deferens problems are all those problems that destroy your normal sexual function. CAVD is the genetic disorder which is characterized by the absence of vas deferens. Azoospermia means absense of sperms on analysis of semen. Obstructive azoospermia happens when there is block in the duct which transmits the sperm from the testicles to the urethra. Non obstructive azoospermia occurs when there is a total dysfunction of in your production of sperm.
Interesting Facts:
Vasectomy (dividing it in two parts) is the procedure to make the male sterilze by preventing the sperm to pass throught it.