Using eq instead of == is a good idea, yes
About the else at the end of your code. It has no sense.
just add plugin::return_items(\%itemcount); without test.
check_handin verifies that you gave the right amount of items and removes them of the list of given items.
At the end of the quest, you call return_items to give back to the player each item that remains in the list. Don't include it in a test, just do it or don't do it.