This question has a very clear intuitive answer: no, it would be horribly wrong. The task of the philosopher is then, typically, to explain why that intuition is correct. (Or, alternatively, to explain that it is okay, after which all the non-philosophers sigh, mutter about ivory towers, and make sure that philosophers aren't allowed to get anywhere near life-ending machines.)
Perhaps surprisingly, many moral frameworks are not very well equipped to deal with these sorts of questions in a satisfying way. You can declare by fiat that life (or human life, or something) has intrinsic value regardless of whether there is anyone there to suffer from or enjoy it. The categorical imperative is also not that clear here: maybe the depressed scientist would think that it would be fine if anyone else took the same actions as he was about to. Utilitarian frameworks are not very good at balancing conflicting goals (the scientist's, to end his suffering, and most everyone else's, to keep living) since almost anything obvious you plug in as a way to combine individual value or desire yields highly counterintuitive results.
But I think when the stakes are so high we can do an end-run around most of the typical concerns. First, it is typically considered immoral to do things to adults that they really don't want done even if they end up enjoying or not minding it. (We don't extend the same courtesy to children to nearly the same degree.) Thus, the point about the suffering is a red herring: you don't need to consider suffering to come to a conclusion. You merely note that most people want to keep existing, and the more of them you kill, the more horribly you're violating their wishes. You can work this into either consequentialist or deontological frameworks (choosing goal-fulfillment as a good, or via some typical formulation of the Golden Rule, for instance; not every choice will yield "the right" outcome, however).
Second, in this example there's another level at which it's the wrong thing to do: evolution selects those creatures which manage to maintain life; as an evolved creature, this scientist is doing the most un-fit thing he could possibly do, and thus from an evolutionary perspective is utterly broken. Only those species that avoid such brokenness will survive and matter in the long run. Many individuals of some species--including humans!--sacrifice their own lives in order to maintain the species, and our moral instincts are powerfully aligned towards this kind of survival when necessary. Inasmuch as morality must serve evolutionary constraints, the scientist would be doing the most immoral thing possible.