What should the SWP do to avoid infiltration like this?
The short answer is disband. The long answer is the following.
First of all, this is nothing to do with the open-ness of the organisation. The SWP is not, by any stretch of the imagination an open organisation. They do not publsh minutes of their meetings or conferences and these are not open to the media or the public, it is almost impossible to find out who within the organisation takes decisions or who holds important positions, none of their internal debates are open to scrutiny by the public, I don't believe they maintain any publicly accessible register of their political positions. Even by the low, low standards of bourgeois political parties, they are far from being an open organisation in the sense that the word normally has anyway. Opaque and secretive would be more honest adjectives to describe them. Of course they can (and do) claim revolutionary imperatives that force them to operate like this - the necessity of hiding the details of their operation from the repressive arms of the state - but to claim that the organisation is open is ridiculous.
The one possible way that they could claim open-ness is the open-door policy towards recruits. Basically, as long as you agree that bad things are bad, they will sign you up (Are you against war? - then join the socialists!!!).
This open-door recruitment policy does not indicate any level of openness in the organisation's culture, in fact it is only possible because of the extremely closed, secretive, unaccountable and hierarchical nature of the organisation. Similar recruitment policies are common among many of the obscuratinist cults such as the scientologists and their ilk and are impossible to practice in any organisation that has any meaningful level of democracy, transparency and accountability - the real measures of an organisation's open-ness.
To explain, an organisation where members have any real say in the decisions that are made has to be relatively sure that new members have a fairly good understanding of the organisation's core politics - otherwise the organisation would shift politics with every wave of new members. This requires a considerable amount of transparency - because new members have to be clear in advance about what they are getting in to, they need to be able to read the policies of the organisation and observe its practice before signing up.
Such open door recruitment policies are exclusively practiced by hierarchical authoritarian organisations where the membership has essentially no say in the decisions made. If new members are to have an equal say with everybody else in decisions, the organisation needs to be sure that they understand the politics before they join. If, on the other hand, all decisions are made by an unaccountable leadership and the new members are merely an exploitable human resource for the leadership, it doesn't matter what they believe, as long as they can sell papers and carry out whatever other menial tasks that they are given.
The other common feature of authoritarian cults is that promotion within the organisation depends not upon any ability to master complex concepts and produce original thought within that theoretical framework, but on the ability to reproduce the leadership's positions and to work as agents of the leadership. Anybody who is familiar with any of the SWP-like political cults knows that the leadership generally gathers a bunch of new recruits around themselves who they use as 'attack-dogs' to launch assaults on their political opponents. New members who demonstrate an ability to skillfully regurgitate leadership lines and use them to launch attacks on dissident opinions are rewarded with promotion.
Now, unfortunately for the SWP, these flaws are not easy to remedy. They go to the core of their authoritarian politics and for them to solve them, they would need to abandon most of the tenets of Leninism. This is obviously very unlikely, but even if they were to have a rush of blood to the head, they would still probably be better off just disbanding and starting from scratch.
It is rare for the social sciences to produce conclusive evidence about the worth of political theory. However, due to the vast amount of experimental evidence compiled during the 20th century, any rational observer can say a few things:
1) Leninism begets brutal tyrannies.
2) Centralisation of power in the hands of any minority is extraordinarily inefficient. Capitalism abandoned Taylorism and the notion of top-down centralised planning well before the second world war - because it simply doesn't work.
Somehow the Leninists have managed to stick their heads in the sand and ignore the overwhelmingly and exceptionally conclusive evidence of these facts. Their politics are stuck in a rigid theoretical framework that any rational person would have abandoned a long time ago as it was proved wrong again and again. Their politics are simply crap and all their other problems flow from this.