Mmmm this wouldn't work on my machine. My young one seems to think he needs 100 coins in just to play pacman. I don't know if he thinks he's going to run out, or he's going to be playing for hours (I only let him play for about 10-15 minutes at a time anyway).
yeah, that's why in my last post I had suggested keying off of the start button instead of coin drops, keeping track of time as PL1 suggested is another good idea too but then you have the problem where someone might leave the machine sitting in game instead of quitting back to the menu.
I think no matter what you do there are going to be "bad habits" by players that can throw off the results.
I like the idea of recording all of it... for each game selected write out to a CSV:
rom_name, start_time, end_time, coins_p1, coins_p2, starts_p1, starts_p2
putting that into a real database would allow you to query it in all kinds of ways.
you might also be able to combat bad habits like building a timer circuit on the coin buttons that doesn't allow more than one coin drop within 3 seconds... I've seen this done for real arcade hardware in free-play arcades for games that don't support free-play, it prevents player from loading up the credits and walking away. maybe there's a way to do this in software?
maybe some other script to check idle time and if a game sits idle for say 5 minutes without any input from the sticks/buttons then it will auto-quit back to the menu.