Lawful isn't necessarily following THE law. It means you follow some code, guidelines, or strict ethical behavior.
This is true, but you have to make some additional qualifiers here. It's not merely following a code, or some guidelines, or having some strict adherence to what you believe is ethical. Chaotic people can have a code, hold themselves to a set of guidelines, and adhere strictly to some standard of behavior. What ultimately distinguishes Lawful from Chaotic is the question of who is ultimately responsible for the code. To qualify as Lawful, you have to be adhering to some externally reviewable code which is imposed by some outside force, and it must be the case that when you are in doubt how to behave you trust the code rather than your own consciousness and wisdom.
The most essential difference between Law and Chaos is over the question of in who rests the authority for establishing what is morally right - the collective or the individual. The Chaotic would advise that if in the estimation of your consciousness, the code was wrong, for you to follow the dictates of your own consciousness and do what you think is right. The Chaotic would also advise that you are ultimately responcible for deciding what the moral code of behavior should be, and hense it follows that even when a Chaotic has a strict code of behavior it is unreviewable because it exists only within the Chaotic and derives its authority from the individual. Other individuals can judge the Chaotic on the basis of thier own internal code, but they can never judge another person on the basis of his own unknowable code.
The Lawful rejects this and says that a moral code is useless if it applies only to an individual and may be overriden by the individuals feelings on the matter. The Lawful says that moral authority rests in some external source - a law giver, a diety, a body of ideas, the social collective - and is codified in to a reviewable body of laws whereby each individual can judge every other individual by the same standard. The Lawful differs from the Chaotic in being able to say, "This is the code I follow, it's an absolute standard, and you can know it, and know when I have departed from it and judge me by that." The Chaotic may be able to say, "I have a code I follow.", but will say, "And you will know it by how I behave, because it is a relative standard and though it applies to me it may not apply to everyone."