I believe there was (at one point or another) something called "Mage Hand" in Cosmos that did more or less what you are describing. Whether it is still there and whether anyone has created any other similiar mod, I'm not certain. An auto-sort for bags would be very handy though, I must agree.