Was the funeral for someone in his immediate family or someone for whom he would be in an extended mourning period? If so, then yeah, he may need some time to mourn before socializing but if that is the case, he will probably decline your invitation to dinner.
I just went to a funeral the other day. It was for the mother of a friend of mine. Immediately afterward I went back to my normal routine.
Your friend will accept or decline the dinner invitation according to his closeness to and feelings for the person who died. If he accepts, you can assume he is back to his normal routine and you should give him the gift. If not, just wait till the next time you see him.
I think you're way overthinking this.