I think, the best way to deal with such a situation, is to openly discuss it with the group and construct rules on how to handle certain devices and activities (doing homework or finishing a chapter). And if only one member of the group is against allowing something, it is forbidden.
Once the rules are set, everyone has the right to demand their enforcement.
Usually, such social contracts have to be maintained and adjusted once in a while, but the longer a group stays together, the more important they get, IMHO.
I once tried to play a simple turn based puzzle game (which I found boring, because it was too easy) during an RPG session. Just to find out whether I could still follow the game.
Even when restricting the game to moments when my character was away from the group and the action, it ruined my game. I was able to basically follow the game, but had not the capacity to analyze the situations, which meant that, whenever I reentered, I had no idea about the mental state of the other characters, leading me to act differently as I would have otherwise.
In situations that “only” needed skill-checks, it took me some time to grasp the situation and when relying on the information I could remember, I often did something stupid or inconsistent regarding my character.
It might just be that I am particularly unable to follow the RPG while doing something else, but no-one can control oneself so well as to give the RPG exactly the attention it needs and no less — how would you know how much attention it needs at every moment, when attention is what you use to judge that?
When I want something to do while my character is inactive, I tend to sketch the current scenes. This keeps me emerged and I don't feel bored.
As a GM, I am very sensitive concerning mobiles and such… usually it distracts me more than the player twiddling with it.
When a player has such a device at hand, I tell him that he will be ignored, as he seems too busy to play with us. The character then just went home, stayed behind because he felt sick, etc.
This is very harsh, but that sort of thing has ruined too many sessions for me.
If it distracts the other players, they usually tell him themselves. If I notice that they hesitate to tell him or he does not react, he gets a warning and if it continues I usually ask him to leave.
If a player refuses to leave but keeps on annoying the group, I tend to have some fun with his character…
My players know that I will usually go out of my way to save them, but if I get annoyed, I will use the rules mercilessly.
Mobiles will be turned off.
If a player has to be reachable, than the phone will be kept out of sight.
Once, a player had to be reachable and his girlfriend kept on sending him meaningless messages. When he turned of the signal for text messages, she started calling because he did not answer. By the third call, he asked her to only call if it was urgent and explained that she was about to ruin the evening for all of us. Two calls later, he explained to us that they wanted to go to the cinema later that night and apparently she was unable to decide what she should wear, how to get to the cinema, and so on…
5 minutes later I answered the phone… we were never allowed to play at his flat, because she was afraid of me.
The only reason for which I will ever allow tablets or such like at the game table is to look up some facts when playing in a real-world setting.
Address the problem at the source: Retcon1 the story. If your players demand an in-story explanation, remember the origins of the owlbear: "A wizard did it."
At the end of the day, all the participants involved are aware that the game that they are playing is a story. The cleanest solution, therefore, to an external (non-narrative) story influence that is just messing things up is to fix it outside of the story.
Simply say "Hey, this encounter? Here's how it really happened. This way, $Player can play $character and everyone can have more fun." It's the honest way, it hurts the least, and it allows everyone to just get on with things.
As a matter of protocol, I give all new characters a "retcon cookie" (but only one) that can be used at any time to adjust their character sheet in any rules-valid way. There are elements of a character that only come out during play that can just be seriously annoying for everyone involved. There is a tacit understanding that this cookie should be used to resolve a player's issue with her character, not as a "oh, we need to get around this in-story problem... I was a rogue all around." But it's quite acceptable if that restriction is spelled out.
1 A definition of Retcon:
/ret'kon/ [short for retroactive continuity, from the Usenet newsgroup rec.arts.comics]
1. n. The common situation in pulp fiction (esp. comics or soap operas) where a new story 'reveals' things about events in previous stories, usually leaving the 'facts' the same (thus preserving continuity) while completely changing their interpretation. For example, revealing that a whole season of "Dallas" was a dream was a retcon.
For your purposes, the retcon would leave the events of the story the same, but simply indicate that $Player's new character did them instead of the old character, thereby preserving continuity.
Best Answer
You've run into one of the dangers of pre-planning a plot. I'll give some ideas at the end about how to plan campaigns so this doesn't happen as much in the future, but first we have to deal with the current situation. Other answers have dealt nicely with the "stay on the rails" and "take a short detour" options, so I'd like to talk about a third choice:
Take a new path through the bush. Forget the plot you had lined up. You've got interesting people and conflicts already present in the world and waiting in the wings, but you can let go of exactly how you expect it to play out. Go along with the PCs' choices and look for opportunities to introduce the interesting people and ideas you have prepared. Instead of killing off this NPC and negating the PCs' hard work, use the NPC as a gateway to new adventures which will incorporate your ideas in new, interesting ways.
It shouldn't be too hard for, e.g., someone connected with the NPC to kick the bucket in a ghost-inducing way, so the NPC drags the party in for the ride and you get a ghost investigation on the party's terms rather than on your own. Players tend to be more engaged with plots that arise from PC agency than plots which are thrust upon them.
Now lets talk briefly about avoiding this kind of situation in the future. For me, the key lies not in how I plan, but in what I plan. Instead of creating interesting stories to walk my players through, I need to create interesting people, situations, and conflicts which are happening when the game starts.
My favourite kind of game prep is to set up a complex set of NPC/faction/world interactions and then watch my players roll through them like a lopsided bowling ball. This way, my players can engage with a world and have their choices matter because they're interacting with dynamic processes. As the party acts and makes choices, I'm free to have the world react: NPCs change their plans based on PC action, natural events occur when it's most dramatic, and so forth.
An RPG story is about the PCs, so I like to give them a chance to really make the world sit up and notice their choices. The best way I've found to do this is to avoid planning stories that hinge on the players making certain choices.