This advice worked at least on 1998 Lexus Ls400.
The main thing to know is to use add mode,
Also it is really important to be fast, specially after the lock-unlock procedure with the door. Also you have to do the lock-unlock procedure 10 times, so first when the car door is open and unlocked, you select LOCK-UNLOCK so you do them both and count them at once, so there will be 5 times of LOCK and 5 times of UNLOCK.
Then you add the key to the ignition, put it from LOCK-ON-LOCK. You have to be fast on this one, if you wait that stearing wheel lovers down you are too late.
And right after this you have 1.5 seconds to press the lock-unlock buttons in the remote, then right after that you have to press either lock or unlock button.
That is the major thing to understand, how fast you actually have to be.
I cannot understand why Lexus tought that the key system in the car is a good one, because I think it is worst system ever, if you loose the master key and have no replacement you are in serious trouble.
Hope this advice helps someone, it was -10 when I was doing this, not fun but hey now the car works again :)