Will I be able to retrain class abilities if on level 2 and 4 I did not have 2 archetype feats and by the dedication's special could not get a dedication in a different archetype?
Not how you're describing it
The rules on retraining are that you must have qualified for the choices you are retraining to based on what you're retraining.
When retraining, you generally can’t make choices you couldn’t make when you selected the original option. For instance, you can’t exchange a 2nd-level skill feat for a 4th-level one, or for one that requires prerequisites you didn’t meet at the time you took the original feat.
At level 2/4 you did not qualify to take a second Archetype, so you could not retrain your level 2/4 Class Feats into an Archetype Dedication feat.
There's another way
In a similar amount of time, you can retrain your Class Feat at level 2 into one of your Free Archetype feats, meaning that at level 4 you could have chosen a second Free Archetype Feat, 'freeing' you up to take a second Dedication with your 4th level Feat and resume your Free Archetype and new Archetype feats at 6.
The variant rule you're using notes that a GM could allow it
The Free Archetype Variant allows for GM's to waive the multi-feat restriction for the Free Archetype.
If the group all has the same archetype or draws from a limited list, you might want to ignore the free archetype’s normal restriction of selecting a certain number of feats before taking a new archetype. That way a character can still pursue another archetype that also fits their character.