Congrats on surviving.
A, get rid of at least half the load on the tank. It's too much weight, too far forward causing the overly soft front end to ride even lower, steepening the head angle.
B, don't chop throttle, as the front will squat, steepening the head angle and further exaggerating the problem. If you can, slide back in the seat to unload the front and slacken the head angle.
C, clamp the knees on the tank HARD, and loosen up on the handlebars, the bike WANTS to go straight. In the aviation world, it's called PIO (Pilot Induced Oscillation). You are consciously or unconsciously trying to correct, and using too much input, which sets it off the other way.
Thanks - good post. I experienced a mild episode of this in my first week of owning a KLR and wondered about this.