I have no easy solution to your problem, that's for you to figure out but I'd be happy to tell you how stat.useItem works.
If we take your example, we want to be able to know when a player uses a golden shovel, keep in mind, by "using" we mean mining a block with it, that's all stat.useItem will detect for shovels. More info about what stat.useItem detects can be found here:
http://minecraft.gamepedia.com/ScoreboardSo, we create a scoreboard, /scoreboard objectives add flashlight stat.useItem.284
In our testfor block hooked up to the clock we type, /testfor @p[score_flashlight=1,score_flashlight_min=1]
When you use an item with stat.useItem your score goes up everytime you use it. So if I dig a dirt block my score becomes 1, if I dig another the score becomes 2 and so on.
To keep detecting everytime you use it you need to add a block after the testfor that says, /scoreboard players set @p[score_flashlight=1,score_flashlight_min=1] flashlight 0, that will reset the testfor block and allow you to use it again.
It can also be smart to add, /clear @p[score_flashlight=1,score_flashlight_min=1] 284 and /give @p[score_flashlight=1,score_flashlight_min=1] 284 before you set their score back to 0, that would replace their "flashlight" with a new one that have not lost any durability.
Hope that somewhat helps. If you have more questions just ask.