Your perception of their intelligence is probably not correct. In high school, everything always seems more dramatic than it actually is, and this person isn't showing any sign of real intelligence, he's just having his late-teen egotistical "I love myself so much" conversation with himself. Some people might say you're reacting the way he wants you to, but your reaction is really irrelevant because I'm telling you, he's really just saying, "Oh dear, I'm truly awesome" to himself. Your negative reaction right now is likely unpreventable but eventually, you'll grow out of stuff like this, you'll react differently, and probably forget about stupid high school conversations like this...I saw a huge change during my college years. I became much more focused on my career ahead and for some reason very suddenly adapted a very different mindset. One day I was sitting around bored and realized that I didn't particularly care what anyone thought of me outside of my academic and professional life, which is the polar opposite of how I used to be...very strange, to say the least. So again, no need to worry, 5 years down the road, you will look back and have the exact same "AH HA!" moment I had during college. You'll also learn to mentally "shelve" things like this so you can deal with them later so they don't stay on your mind and bug the heck out of you. The human mind is amazing, it's always adapting and changing throughout life.
Basically, you most certainly have no need to worry about this. You'll always be "modifying" your own behavior over time, so just take whatever lessons you can learn from this, apply them, and move on.