I used to work on the Cunard ships, On the Bermuda run when possible we used to pay for a U.S. immigration official to fly to Bermuda the day we departed er route New York. This was not compulsory and not always possible (availability of an immigration agent) The reason for this was to expedite clearing the ship (not just aliens but all passengers and crew) It made our clearance time in New York much faster and less painful. The cruise line paid all the expenses (air fare cabin food etc) for the official and they in turn had a short cruise back to N.Y. This is only possible when the port before the disembarkation point is close (The official can't be spared for an extended cruise for just 2 or 3 hours work). We sometimes were able to get an official between St Thomas & San Juan when in the carib.
Hope this helps