GOODMORNING is being used as a verb here, which is not usual.
It's very funny. If you read the part right before, there is a discussion about all the possible things 'good morning' might mean. In this case, Bilbo is basically using it to mean, 'go away, I'm finished talking to you.' So Gandalf is offended, as he is a wizard but is being dismissed as if he was just an annoying door-to-door salesman.