Well it's most likely stress or habits if i say so.
This is more likely the best answer. Stress or just pure habit.
I myself don't drink or smoke, but I do drink coffee, lots of it.

I drink it even if there's no sugar in it, black, as many others call it.
I drink coffee when I'm working, doing random things - like fixing motorcycles and vehicles, tinkering, and whatnot. Even when playing video games, I drink coffee.
It somehow became a habit; like I could no longer do what I do without a coffee beside me. Stress? Yep, a cup of coffee solves that for me, too.
So, I guess when it comes to people who smoke or drink, that's probably the reason why they do it, too.