Depends.
Running duplicate queries is bad, duplcating code as well - but if it's only 2-3 lines of if () do smth. this shouldn't hurt
I'm not worried about the duplicate query, too many people seem to get hung up on how many queries things use. The extra select this will run is neither here nor there (milliseconds). I'm more interested in the general way coders are going to go - is it better to use hooks as much as possible to avoid file edits, better for the end user, easier to install/upgrade etc - but messy for the writer - or continue to hack the files and avoid messy tricks.