I believe should not be distracted from the game to chat,especially if you play a lot of tables.
I agree with this 99%. I actually deactivate my chat so I don't have to see what people say and I can't say anything to them. I did it mostly with the intention of efficiency^. I think chatting can be a useful tool any info you can pick up is always +EV, be it through convo or just listening. You can pick up on players tilting at the table or even just at life in general and take advantage.
My opinion on how you react to making a friend at the table is this. If making friends and chatting helps keep you on your A game when you might otherwise be bored and play less than optimal then it's 100% good. Otherwise, if you're really playing to win and make money you should chat with an objective. Finding out anything you can about everyone at the table is never a bad thing as long as you're not giving away too much info on yourself in the process.
Chatting with the intent to weed out better players and avoiding them and finding the rec players and getting in pots with them is ideal. If you can make friends with the guy to your left or right and they decide to take it easy on your blinds and not reraise you and generally play more straightforward this can be a huge advantage. If you can piss someone off in an acceptable manner and tilt him into making mistakes that's a win and so on. Just don't afford them the same luxuries and definitely mix it up against your table buddy. Depending on what you think he thinks of you, you may be able to get away with some things and claim you had a big hand, you had to reraise..