I actually was planning on doing something like this for maybe a mini game for Sonic's Vacation, but... I got lazy...
The way I would do it would have a file with timings for the arrows for each song just like how Stepmania does it. And of course, I would have made an editor so you could record your button presses and then reload that ingame, just like in stepmania... But then I got lazy...
Of course, if you're feeling up to it...