On first sight, I fully agree, on those unscheduled landings, nobody should worry about immigration papers.
On the other hand, if some country says that everyone on a flight with a medical diversion could enter a country, then it every terrorist would enter any country by having a heart-attack ... and 200+ of his fellows can enter the country.
This is an airport used for emergencies, no matter technical or medical, and they should just call in the customs officers and everyone could enter enter the country, no waiting in a frozen plane.
I am sure this would only happen every third or fourth year, and those officers would probably very proud to help. In this case, it seems that were was no emergency plan existant whatsoever.