Repeat last command

I want to know whether Rhino can repeat last command and use input or output parameters from last command as input parameters without interact with user. If not, whether can implement it with api and plugins.
For example, there already is a curve and a command can copy it to new place, if repeat this command will create new one from curve created by last command with same distance.
I notice sample “SampleCsHistory” and method “ReplayHistory”, but don’t know how to trigger it and not sure it is related to my idea.