I always thought it was referencing beauty and the beast. Cause the same things happen in beauty and the beast. In Aladdin it's not a spell. It's just a genie with magic. In beauty and the beast it's actually a spell on the castle.
They only problem with this is the fact that Disney has said Rapunzel, Anna, and Elsa are cousins. Rapunzel and Eugene wouldn't be old enough to have Hans. Hans could be Rapunzel's cousin on her dad's side from another island though.