IIRC the couriers were invulnerable, making the strategy even stronger as you couldn't kill them to stop the flow of consumables.
Also, according to this Q&A post on reddit (https://www.reddit.com/r/DotA2/comments/bf49yk) the consumable purchasing logic was scripted, not learned.