I think if you /clear town you will leave the town and you cannot steal from it until you have completly left the town. Before stealing from it you have to be at spawn or at least outside the towns protection. Then you can go and raid the town that you wish to raid. Keep in mind that you cannot put holes in the wall or any sort of defense the town has. You cannot leave holes open to get in and out of the town. You have to find your own way in. This is in my opinion.
Ron has clarified pretty well. You cannot join a town and then during your stay set it up for raiding. This is in offense to the ruling made for no insiders or town betrayal. It may need clarification or a change in wording to ensure people make no mistake, but it is illegal.