Do you want the player to be given one unit, or be able to build a new type of units?
For the first, use "Unit - Create 1 (unit type) for (triggering player)"
For the second, I guess the Techtree thing should work, but you will need to disable the unit for everyone first (at map initialization), and then allow it to those who know the code.
Also, you propably would need "Clear text messages", so other players won't be able to read the code.
Also, if you are giving player the unit, you need to check whether he was already given one, so that he won't be able to spam these bonus units. (Either count units in unit group, OR use some boolean array, where you save who used the code in this game)