This is one of those, "Doctor - it hurts when I do <this>. Doctor says 'well don't do that'", kind of situations
In all seriousness, once you realize that you forgot to install your plug (by the truck not doing anything when you press the start button), take your foot off the brake and press the start button again to shut the ignition off.
By doing this, you kill power to the PCM, so it can not continue trying to initiate the start sequence, time out, and set the code. You have about 5 seconds to do so.