In an interview with iFMagazine, Sir Ian McKellen confirmed his involvement with the Lord of the Rings prequel, The Hobbit, saying "I have been been promised I'm in it," a mere twelve hours from eating dinner with Hobbit director Guillermo Del Toro.
As for X-Men Origins: Magneto, the next possible X-Men spin-off, McKellen isn't sold: "If the Wolverine movie does well, they'll probably just do another Wolverine movie." Even if it does, McKellen likely won't be involved: "If they do a spin-off, it would be about the young [Magneto]."