In the slicer a pause can be added to the print:

Choose the first layer covers the internal hole for the key by using the layer bar in the right side of the slicer screen. right click on the orange plus and choose “Add Pause Print (M601)” this will cause the printer to stop right before it begins printing the chosen layer. A comment can be added to the pause like “Insert Key”. a support block is being printed so that the key can rest on it until the print is done.
I have made 2 G-Codes on with and one without the hole, these are made for PETG and automatically stop when the key needs to be inserted.
Happy Printing!!!
The author hasn't provided the model origin yet.