The scientist whose idea for an X-ray laser inspired President Reagan's "Star Wars" plan is returning to a nuclear weapons research center he left because of objections to military work. Peter Hagelstein, 32, said in an interview published in the San Jose Mercury News that he will do only unclassified, non-weapons work on the X-ray laser program at Lawrence Livermore National Laboratory. His contract calls for him to serve as a consultant for up to 45 days this year at a rate of $315 a day. However, some scientists say parts of his research, such as a computer program for the laser, could have applications for the Strategic Defense Initiative, a space-based missile defense system known popularly as "Star Wars." Hagelstein left the lab, where he had worked for 11 years, for the Massachusetts Institute of Technology four months ago saying he wanted to do research to "benefit all mankind."