Frankly, Hermione was appalled that selling them so willy nilly was legal. That essentially altering a person’s mind against their will was considered recreational fun by some. But she wasn’t above taking advantage of the opportunity it presented. The trick was having him accept it unknowingly, and then ingesting it when she was in the vicinity. She had no intention of letting him gallivant through the castle looking for her. Making a fool out of himself, and making it obvious to any onlooker what she had done.