I'm using a magic mouse and the laptop trackpad and have seen the problem in both situations. I know I have taken my hand off the mouse to start typing.
I tried your suggestion and kept my finger on the mouse whilst typing and sure enough you cannot type with the mouse down, but as soon as you release the mouse the typed text appears. When I'm having my problem the missing typed text never appears.
You could try turning off TimeMachine. In my experience, TimeMachine has poor manners. I keep TimeMachine turned off and run it manually at intervals. Only do that if the safety of your data is less important than the occasional loss of keystrokes. It may be something else, in which case I would suggest that you keep an Activity Monitor window open and see what process is hogging the CPU when the problem happens.