For short periods of time, prescription medications (such as narcotic pain medications or muscle relaxants) may be helpful to alleviate pain or related complications.
It can take anywhere from 4-10 hrs. now if your head gasket is warped you will have to take it to have it milled that takes from 1 day to several days. if not you can just buy a completely new one that fits perfectly for about $150.
Once you have your gas plan, attach your keg to the carbon dioxide tank adjusted to the pressure dictated by your gas table and wait. A batch of homebrew is small and the headspace pressure will equilibrate with the beer in about 3 days. The only thing you can do to speed this method up is to periodically shake the keg.