Wilson was the sort of person who could get into a set of revolving doors behind you and come out ahead of you.
He had non-consecutive terms because, well, he won an election, lost a second (all because of Peter bloody Bonetti), and then won a third because his opponent, Heath, was a less-than-stellar politician.
Winston Churchill also had non-consecutive terms, as did Stanley Baldwin, Ramsay MacDonald, and Gladstone had 4 non-consecutive terms. There's nothing special about non-consecutive terms.
As for him being a security risk - the same source, James Angleton of the CIA, who told Peter "I'm a total fantasist and will say anything to sell my book" Wright that Wilson was a security risk has also said that: Kissinger, Lord Mountbatten, de Gaulle, and Edward Heath were all security risks to their various countries. One assumes that Angleton was paid by the number of allegations he could come up with, no matter how idiotic.
MI5 dutifully investigated, and found that "Henry Worthington" (the name under which the MI5 file was held) was no more a security risk than the Downing Street cat.
Whether he was trustworthy, that's a separate question. He had to keep the Labour party together, and that meant convincing every faction within the Labour party that he was one of them (and in from the October 74 election onwards, he had a parliamentary majority of just 3. Which meant he had to keep every single Labour MP happy, and it's in the DNA of Labour MPs to be bloody-minded and cause difficulties for the Labour Leader). So he lied a lot to the MPs.