The cockpit exit door in the roof is a customer option on the 747. Here's pic of a NW 747-400 that has one:
http://www.airliners.net/open.file/1177779/L/
I remember at some point one airline had these installed as an anti-hijacking measure, under the theory that if the airplane was hijacked and landed (such as for re-fueling), the cockpit crew could bail out through the roof hatch to remove the possibility of taking off again from the hijackers' set of options. This was controversial at the time, as people had mixed feelings about the cockpit crew abandoning the ship with hijacked passengers aboard.
I don't know why using the cockpit window as an exit would not work in such a situation, but somebody felt it was important enough to add the exit hatch to the roof.