It shouldn't be that hard to program.
1. Add a linked list hook into the entity code, so that every structure can hold a list of other entities. In this case, the list would contain "held" entities (primarily, player and NPC entities).
2. Add each on-board player and their relative coordinates to this list when that player enters a computer, control chair, activates logic, activates a door group, or exits the game (basically, does anything on the structure), and take them out of the list when they leave the structure's bounding box and are no longer aligned with it. If a player hasn't done anything to merit being on the "held list", they probably don't need to expect that they are on-board the ship when they return to the game.
Then, whenever the player logs in, they are teleported to the ship on which they are listed, at the coordinates stored. If a bug causes them to be on more on than one structure's list, the first list wins, and subsequent lists have that player purged.
This process lends itself well to database storage and retrieval, so when a player logs in, the game can do a quick query search of the saved data for only that player, to determine which entity they are in, if any. If they are found, they are teleported to the holding entity. If not, the existing logic takes over and their regular logoff coordinates are used instead. It should be a quick subroutine added into the existing logic.
To log in multiple people at once, there probably needs to be a delay between subsequent players, so that if a whole pile of players logs on at once (for instance, maybe a popular server just rebooted), it won't crush the server.