It really depends on when the crew discover the stowaway. I would bet, though, that they'll choose to restrain the person, report the incident to Mission Control, and then, after talking with Mission Control, abort the mission.
Reasons for aborting:
- The person could be trying to sabotage the mission and/or hijack the shuttle. This could be especially worrisome if the payload includes a military satellite.
- The person could have already sabotaged the shuttle or placed a bomb on board; if possible, the crew (and the payload!) need to be gotten somewhere safe.
- Having another person on board means that the crew may have fewer resources.
- Doing otherwise could have a negative psychological impact on the crew members.
Shuttle security breach
The plausibility of a stowaway, as others have said, is doubtful. It would very difficult for the person to board the shuttle at all; it's a few orders of magnitude harder than breaking into a car, for example. Post-9/11, public access to Kennedy Space Center was restricted around the time of shuttle launches. In the first mission or two after the attacks, even the planned launch time was kept secret, meaning that this would-be stowaway would have to either be on the inside (which would help with other aspects of the plot) or be a very good guesser. Even then, the launch could be scrubbed and moved back because of things like inclement weather. The person could be kept hiding for days, likely with minimal provisions and supplies.
Military personnel have often been used for security (for instance, before Columbia's final mission, because Israeli astronaut Col. Ilan Ramon was one of the members). We're not talking about a few security guards with nightsticks; we're talking about military-grade weapons used by the actual military.
1. T-0 to T+8:30
In this case, you probably want to abort the mission as soon as possible. Someone unknown is in a spaceship and could have a weapon, bomb or other harmful device. They could hijack the mission and cause serious problems. There's very little this person can do in the early stages of the launch, so that's when the crew need to act.
Once the solid rocket boosters (SRBs) were ignited, no abort could be performed before SRB separation, roughly two minutes into the flight. After that, there were several abort options, :
- Return to Launch Site (RTLS), involving jettisoning the external tank and landing at Kennedy Space Center.
- Trans-Atlantic Abort (TAL), involving jettisoning the external tank and landing at one of a number of sites in Europe and Africa.
- Abort Once-Around (AOA), involving a modified flight pattern circling Earth once before landing somewhere.
- Abort To Orbit (ATO), involving reaching a lower orbit than intended.
The optimal options here are RTLS and TAL. AOA only had a very tiny window in which to initiate, and ATO meant that a modified mission will still go on. RTLS and TAL meant that the Shuttle could land very quickly and stop the mission.
2. T+8:30 onward
Main Engine Cutoff (MECO) occurs at T+8:30. After this point, the crew likely can no longer perform an RTLS or TAL abort. An AOA abort would get them back to Earth, but again, that might be hard to do. What the crew can do is go into a modified orbit, using an ATO abort. If they're already in orbit when they discover the stowaway, of course, then they'll stay where they are.
So, they're now stuck in a spacecraft with an unknown person - again, potentially harmful. Their course of action depends on what the mission is. It could be any of a number of things, including
- Going to the ISS or another space station.
- Launching a civilian satellite.
- Launching a military satellite.
- Repairing a satellite or telescope (such as Hubble).
All of this takes time. If the crew has performed an ATO abort, though - which they likely have - then the mission is compromised. They could move to a different orbit, yeah, but there's already a wrench thrown into things. Who wants to launch a satellite with a potential psychopath in close quarters with you?
The point is, the best thing to do is go into a lower orbit and do a final consultation with Mission Control before returning to Earth with the mission incomplete. Better safe than sorry.