RBG*:
That's because the confusion attack in generation 4 is a Normal-type attack, so it's affected by Chilan Berry. What matters for the purpose of the damage-reducing berries here is the type of the confusion attack, not the type of the attack the Pokemon would have used (such as Earth Power).
* For generation 4, I state that "The self-inflicted confusion attack is a Normal-type physical attack".
* For generation 4's Chilan Berry, I state that "As the holder is damaged by a Normal-type attack against the holder [no matter who used that attack], that attack's damage is halved".
* For generation 5, I state that "The self-inflicted confusion attack is a physical attack [and] has no type".
* For generation 5's Chilan Berry, I state that "As the holder is damaged by a Normal-type attack by another Pokémon against the holder, that attack's damage is halved".
That's because the confusion attack in generation 4 is a Normal-type attack, so it's affected by Chilan Berry. What matters for the purpose of the damage-reducing berries here is the type of the confusion attack, not the type of the attack the Pokemon would have used (such as Earth Power).
* For generation 4, I state that "The self-inflicted confusion attack is a Normal-type physical attack".
* For generation 4's Chilan Berry, I state that "As the holder is damaged by a Normal-type attack against the holder [no matter who used that attack], that attack's damage is halved".
* For generation 5, I state that "The self-inflicted confusion attack is a physical attack [and] has no type".
* For generation 5's Chilan Berry, I state that "As the holder is damaged by a Normal-type attack by another Pokémon against the holder, that attack's damage is halved".