In an event;script:
poke=$Trainer.party[$Trainer.party.length-1]
poke.eggsteps=1
Remember, $Trainer.party.length-1, will return the last Pokémon in the list... 0, will return the first Pokémon... 3, will return the forth, etc.
This is me guessing that you want to add an egg to the team with 1 step remaining... However, 1 can be any number you like, 10, 100, 1000, 43... Change it to how you need it.
Change the part in between the [] to accommodate.