Script for translating existing keyframes-Help!

Hi, I’m trying to write a script to automate part of my rotoscoping process, and I’ve come to a dead end. What I want is a script to duplicate the selected object, move its existing keyframes over by one frame, and then enter edit mode. Duplicating and changing modes is easy, but I’m stumped on how to script the translation of keyframes. Maybe I’ve missed something or didn’t read some documentation somewhere, but I cant find anything about how to do this. If anybody has any ideas, I’d be grateful if you could help.