What probably makes the most difference between the two is thinking about what you are writing. No matter how. Typing is likely to have the same effect provided you're not simply blindly copying stuff.
A more powerful effect that you hint at is the fact that writing by hand transfers the information to a physical location. You remove a layer of abstraction between your memory and what you've written down (yes we try to tie virtual stuff to a 'location' as well, but quite a lot of problems can be explained by people struggling with that abstraction).