Hi Andras,
This is pretty basic chemistry that we teach in our introductory chemistry classes.
I can't give you a copy of our textbook but the Wikipedia entries might help:
http://en.wikipedia.org/wiki/Lewis_structures and
http://en.wikipedia.org/wiki/Resonance_structure
It seems that you are missing one of the key concepts here: the structures are operationally invariant, or in other words:
you are not allowed to perform any transformation (including rotation) to "convert" one structure into any other structure. The only particles that are allowed to move around in the image are subatomic particles, namely electrons.
Since each bond represents an electron pair that is mutually shared between two adjacent atoms, it actually matters which two atoms are involved. The double bond in the first image is sometimes pointed down, sometimes pointed up/left, and sometimes pointed up/right. The atoms are not interconvertible. What happens is that two pairs of electrons are being pushed around. First one of the three pairs from one of the single-bonded O is pushed into the bond to the N making for a double bond, and next one pair of electrons is pushed out of the existing double bond into the previously double-bonded O. The atoms do not move at all in the process.
Each bond is a pair of electrons, as is each "lone pair". Each radical is a single electron, but we are not concerned with that just yet. If we let ":" represent an electron-pair, I can rewrite :::O-N=O:: <-> ::O=N-O::: to :::O:N::O:: <-> ::O::N:O::: . Since I am not allowed to "flip the molecule around", these two (partial) resonance structures are distinct. In fact, they represent two extreme situations that describe some of the properties of the "average" molecule. To quote from Wikipedia: " The individual resonance structures do not exist in reality: the molecule does not inter-convert between them."
Thus, if I have a SMILES [O-]1[N+]2([O-]3)=O4 it is distinct from the SMILES [O-]1[N+]2(=O3)[O-]4. But that is not the whole story: I also have to count the lone pairs on every single atom to make sure they follow the "octet rule":
http://en.wikipedia.org/wiki/Octet_rule
Whereas in the first image I submitted, electrons are being moved around to yield three distinct resonance structures, in the second image nothing is being moved around. In the first case, the student knows the significance of all the Lewis rules, in the second case the student is either trying to cheat the system or doesn't know what is expected. In both cases, though, MSketch generates the exact same SMILES+lp answer key, which means that I cannot distinguish the good students from the bad (and makes the application useless for this purpose).
Now, if MSketch did not automatically rewrite all SMILES strings into a canonical form (putting the =O always last) I could write an algorithm to determine whether the total number of electrons in bonds + lone pairs + radicals is correct or not. What I cannot do is expect the students to label all atoms consistently through the GUI, nor can I give them labeled template SMILES to begin with because it would give away the expectations for the answer (for instance how many resonance structures are expected).
I hope that clears up some of the misunderstanding of what I am trying to achieve here.