The capability of generating two intense, femtosecond x-ray pulses with controlled time delay opens the possibility of performing time-resolved experiments for x-ray induced phenomena. We have applied this capability to study the photoinduced dynamics in diatomic molecules. In molecules composed of low-Z elements, textit{K}-shell ionization creates a core-hole state in which the main decay mode is an Auger process involving two electrons in the valence shell. After Auger decay, the nuclear wavepackets of the transient two-valence-hole states continue evolving on the femtosecond timescale, leading either to separated atomic ions or long-lived quasi-bound states. By using an x-ray pump and an x-ray probe pulse tuned above the textit{K}-shell ionization threshold of the nitrogen molecule, we are able to observe ion dissociation in progress by measuring the time-dependent kinetic energy releases of different breakup channels. We simulated the measurements on N$_2$ with a molecular dynamics model that accounts for textit{K}-shell ionization, Auger decay, and the time evolution of the nuclear wavepackets. In addition to explaining the time-dependent feature in the measured kinetic energy release distributions from the dissociative states, the simulation also reveals the contributions of quasi-bound states.