I'm wondering if AI will pose a threat to Bitcoin in the future? I mean, if AI is able to code on its own, maybe it will make a coin superior to Bitcoin? Or maybe, Bitcoin can make use of AI for its own benefit.
Thoughts?

Pose a threat to Bitcoin in which manner? I mean, what kind of threat are you referring to? Because if it's just about the coding aspects, by developing a new project that can be superior to Bitcoin, nothing like that will happen.
It took many years for Bitcoin to grow to the length in which it is right now, people keep buying Bitcoin every year and the growth is continuous.
There's no AI that will just code a coin today and you expect people to starting buying the coin, then the coin starts to grow rapidly. It will not happen like that, but if peradventure this your assumption come to light, the coin will not be superior to Bitcoin because before it will want to get to the value at which Bitcoin have attained now, Bitcoin will be far higher than what it is as of today.
Take for example Ethereum, why has it not even cross $10k? Despite all the bull Run of Bitcoin?