What a fun little idea... Can't think of any specific pre built electronic hopper systems that would dispense sweets in that way, unless you could rip something out of a cigarette machine? Perhaps you could knock something together with a small arduino board and a gumball, spoke type dispenser. The number of rotations of the spoke wheel determines the number of sweets to be dispensed.
Perhaps you could get away with just having a small wheel with a wedge cut out of it and have a small tank sit above it with the sweets in it, link mame up to the arduino and have the wheel rotate to dispense the sweets. Perhaps you could even include a small infrared beam sensor to monitor the payout count.
There must be a more elegant solution though, I'm no expert after all