Legal/illegal...I'm not so sure.
We had this discussiona few months ago, and AC seems to take a pretty relaxed view, unless you are doing it specifically to avoid things like Saturday night stay requirements, etc.
In the late 90s, I often bought a three month ticket LHR-YYZ-LHR, outbound in June, back in September, and then bouught a few YYZ-LHR-YYZ tickets because they were cheaper from Toronto. You can't tell me that AC can stop me from doing this, since there are any number of reasons why I might decide to go back and forth a bit.
I really think it depends on circumstances, and there is some leeway built into the system.