You don't think the guy would be capable of doing the same thing if a clueless flight attendant was there while pilot is taking a leak ?
Well, the "clueless" flight attendant would be less clueless after the nose-dive started. Then they'd know to unlock the door for the pilot. I guess the co-pilot could have subdued him/her first. But, unless the co-pilot was a ninja, there would have been a struggle of some sort, which would have alerted front-row passengers, who would have alerted the pilot. (Or the pilot would be alerted himself, if the head was right outside the cabin.) The flight attendant may also have been able to fling open the door, so that even if s/he was overwhelmed other passengers could go in and try to wrest control while awaiting the pilot.
But, even if the co-pilot was a secret ninja, having a second person in there would have immensely lowered the possibility of his success. The attendant could have been an unwitting distraction to him until they passed over the mountains or the pilot came back; the guy might have done this as sheer end-of-the-world depression and having another physical human could have dissuaded him; maybe the attendant's idle banter while waiting could have made the co-pilot tip his hand, at least putting the attendant on guard.
Perhaps incorporate emergency biometric scanner or something like that on the door that can override the "unlock" option ?
(I assume you mean lock and not unlock.) Yes, because let's use technology to completely defeat the purpose of the technology put in place already. Then someone trying to hijack the plane can wait for a pilot to come out, grab him, and use his thumb/eye/whatever to get in even after the copilot flips the switch to "locked". You could use a remote system from the control tower to override the lock, but good luck keeping it completely uncrackable (or just having someone storm the tower and threaten the air control).
I'm a big computer guy and think we'll get some incredible tech in the future, but there will still be many times when human presence is still miles beyond any tech, even after the AI singularity.