So, when you're about to buy a guitar, whether it's new or secondhand, what are the first things you look for?
See if it rings nicely. Electric guitars should sustain a lot. Listen to the guitar unplugged. It should ring and sustain without an amp with overdrive.
New guitars should have near perfect finishes too. If you are buying a real budget model then imperfections are likely, but on pro quality stuff that is meant to look new, they should be without flaws.
How do you decide whether buzzing is because of bad frets / bad setup?
It's almost invariably because of those reasons. The important thing to check is whether it can be fixed. If the neck is too straight or the action is too low, or the nut is cut too deep, its pretty easy to fix and so a minor hassle. If its a new guitar and the frets are in bad shape maybe put it down and look at another one. New guitars should be 100% playable after a rudimentary setup. If they're not, they're badly built, move on.
What's the first song you play?
EZ's noodle in E ?
What'll make you put a guitar down?
If its fiddly (sticky knobs, sticky switch) or if it doesn't want to sustain nicely or the setup is really bad or the strings are really old.
I played a whole lotta Teles a month or so ago in various shops and some of the cheaper ones were just plain bad. Some of the expensive ones had sticky knobs, they'll get stuck on 0 or 10 and will only come loose with some force. Not good. Almost all had old strings on them. Like rusty old.