@Finaltwist
\Scripts\Items and addons\Containers\Container.cs
inside class Backpack, line 426, you can add following code:
//We try to find that item already exists in bags inside Backpack and stack them together
public override bool TryDropItem(Mobile from, Item dropped, bool...