Artemis and Butler tricked the mesmer by wearing mirrored contact lenses.
It's part of the plot point for the next book: The Opal Deception.
When Artemis "meets" Holly for the "first" time, Artemis recalls finding contact lenses in his eyes, with no memory of ordering them:
"After my alleged mind wipe, I discovered mirrored contact lenses in my own eyes and in Butler's. Investigation revealed I myself had ordered the lenses, though I had no memory of the fact. I suspect that I ordered them to cheat your mesmer."
Chapter 5: Meet the Neighbours - The Opal Deception
Holly then confirms that they indeed could have tricked the mesmer by wearing these contact lenses:
Holly nodded. It made sense. Fairies had the power to mesmerize humans, but eye contact was part of the trick, coupled with a mesmeric voice. Mirrored contact lenses would leave the subject completely in control, while still pretending to be under the mesmer.
Chapter 5: Meet the Neighbours - The Opal Deception
Because Artemis and Butler were not under the mesmer, they were free to lie about any plans they had made. The memory wipe still happened, but their plans to cheat it were not discovered.
To answer why Foaly didn't notice or register any foul play during the mind wipe: he had already double and triple checked.
Foaly noticed Artemis had emails ready to be sent back to him with fairy information, storage space on the internet with fairy info, they even found his buried time capsule, filled with his diary and other notes. Foaly installs something on the computer system designed to remove any and all information relating to the People that would stay there for the next six months.
You have to keep in mind that Artemis Fowl is a genius. I'm not saying Foaly isn't smart as well, but Artemis managed to escape from the bio bomb in the first book; something no one else had ever done before.
Similarly, no one had ever tricked the mesmer and the mind wipe before. So why should Foaly worry after he's already done his due diligence? He sees a mesmerized human, who says they're hiding nothing, so why should he question it?