You could edit the mega evolution script so that it checks the player's bag instead of checking for a held item. That way, the player just needs to have the appropriate mega stone in their bag to mega evolve a pokémon, and then that pokémon can hold whatever item they want.
so what is the problem there?
Are you unable to make a gym map and place a trainer(the gym leader) there?
Are you unable to implement a 9th badge?
Something totally different?
What exactly is the problem?