There is an inventory behavior available here:
https://luyren.itch.io/luyrens-rpg-elements-resource-packThere are custom blocks to add and remove items to the inventory, as well as custom blocks to check for item amount and other things.
As for your own code:
You can use two lists, one with the item name and another with the amount, and make sure their indexes always match. So if you are referencing index 0 in one, you are also referencing index 0 in the other.
If your inventory can only have one item stack, you can have a map attribute with the name as the key and its value as the amount.
Another option is to store in one list both name and amount with a separator, for example "Wood/60", and use the split text block to retrieve the amount. This will require more text manipulation when modifying the amount.