Laws are not rules written in a programming language. Exploiting logic errors and corner cases does not work the same way. Don't make this mistake.
Whether a court will let your clever workaround pass or not is up to them. If what you do is not in their interest (or there are other forces present, like the government or lobbyists), you may find that the law is _very_ flexible in its application.