Can diazepam be used as a muscle relaxant? Would a doctor prescribe it for that?

Can be. There are no good muscle relaxants- think about it-if you take a pill that hits all your muscles and made them relax (not contract) you would be too weak to stand. All meds are a compromise to try to decrease spasms, but not be too dangerous. Diazepam (valium) is one that can be used in this manner. But must be used carefully as people can become dependant upon it. Short term use (days) only.
Yes. Diazepam is a "minor tranquilizer" which has muscle-relaxing properties. Among its side-effects are drowsiness, and that it's habit-forming.