There are no effective rattlesnake repellents. Paradichlorobenzene is the active ingredient in one type of mothballs. As such, it is a pesticide and must be used according to label instructions (the label for mothball products does not mention snakes).
There is a registered pesticide called "Snake Away" that uses naphthalene as a contact repellent for snakes. Unfortunately, there are no scientific studies as to its real effectiveness.
Consider putting up a snake fence, with 1/4-inch hardware cloth 12 inches below ground and 18 inches above ground.
Online Resources:
Venomous Snake Control
