I am not sure, but in some situation both seem to mean the same thing. Is it? I feel "thinking" implies that you are doing it now so "while" is redundant. If that's the case, why would you use "while"?
He was laughing while thinking at the things you said yesterday.
He was laughing thinking at the things you said yesterday.