How Black Star was influenced by the Kishin's hallucinations? Caution: contains spoilers.  


  In episode 23, when Black☆Star approach to Eruka he was under an illusion. When it comes to the sixth sense (soul wavelengths), Black☆Star admitted he immune to the effects of the Madness. So why when he use the Enchanted Sword he was affected by the madness illusions?
Ok, it took me some time to find it. You are referring to this: 


  


Knowing what kind of person Black☆Star is, I wouldn't take his statement neither too seriously nor too literally. 

It is known that it is possible to overcome madness if one has bravity and a strong heart. Black☆Star definitely has those. In fact, it is shown in the Baba Yaga's Castle mini-arc (if you excuse me for calling it a "mini-arc"), that Black☆Start indeed is capable of overcoming Madness, at least to some point. Note that in that mini-arc, after Black☆Star encourages the other characters, they are able to overcome Madness as well after hardening their minds. 

We also know that later Black☆Star


   gets the ability to use Madness Release (Hakkyou, 発狂) changing his Wavelength to one of Madness. 


However, according to the same wiki that you referenced, even he has a possibility of slipping into Madness if he uses this ability for too long. It is also stated here that the stronger the Madness Wavelength, the harder it is to overcome Madness.

Considering the above, another important note is that in Baba Yaga's Castle mini-arc, Black☆Star was rather far away from the source of Madness, while in the episode you mention he was right near it; more than that, the source was kishin himself.

So I think that while Black☆Star indeed has some sort of resistance to Madness, his statement in that episode was partly bragging, partly overestimating himself and underestimating the enemy, which eventually let him susceptible to the (quite powerfull themselves) illusions.