All of the hospitals in our area got together and decided some general guidelines for diversion (ie, the trauma center can't go on adult trauma diversion, at least one of the psych hospitals has to be receiving patients, at least one facility with OB services has to be receiving patients, etc.)
This works fairly well. The bed management supervisor of each hospital changes the status of the hospital on a website, and if the hospital is closed to all ambulances, they have to re-evaluate that position at least every 12 hours. The trauma center (biggest hospital) sort of polices the situation because if all the hospitals are on diversion, ALL of the patients are coming to that one.
The system was started about 8 years ago after a 2-week period in the summer time when the situation was like you described...crews on scene begging for a hospital to take their patient. The hospitals were forced into negotiations when the EMS supervisors just had the crews take the patients to any hospital, because once the patient is in the facility, EMTALA takes over and the facility is stuck.
Our situation was never as bad as I've heard out of California, where you wait for hours with the patient on the stretcher. A long wait for us, then and now, is about 20 minutes.
The system is administrated by our regional office of EMS, who got a rep from each hospital to sit down at the table with reps from the 3 or 4 biggest EMS systems in the area. It was a very collaborative effort, and seems to work pretty well.
Now, with MDTs on the trucks in the system I used to work in, when you go to mark your unit transporting to the hospital, the MDT prompts you if your hospital is on diversion, tells the type, and allows you to override it, in case you have a special case. It's pretty cool, and completely hands-off as far as system admin is concerned...the MDT is linked to the website. Super high-tech,

. I'm easily impressed.