
The emotion chip shouldn't have any impact on Datas ability to laugh...
Despite the common misconception, laughter is not an emotion. It is a response to a wholly intellectual processes. This is why a dumb joke is generally not funny to a highly intelligent person and an erudite joke goes over the head of an idiot. While laughing can elicit emotion, it doesn't require it. So this brings us to the conclusion that either Data has no sense of humor, or that most jokes are beneath him. So this leads me to believe that the joke Q told him was sufficently clever to be funny to Data, then Q made him forget immediately thereafter. The emotion chip is literally making Datas sense of humor dumber so he can relate to less intelligent beings humor.