Unfortunately, as you mentioned, this does not function by id, but rather by slot. What you need is this: PickupContainerItem(container, slot) You can use PickupItem, for example, to put an item onto an action bar (since you're actually placing a reference to the item), but it won't let you use it to say, trade an item to another person, or in this case, move an item in your bags. What this means is that while the item really is on the cursor, it has no origin information. PickupItem doesn't pick up an 'icon' as much as it picks up a reference to the item.
The real thing actually need to scan your whole bags, find what you need, keep in memory the bagslotid, then from there move that bagslotid to the bagslotid you want it to be. What he get is pickup the ICON (not the item) and try to put the icon in bag.