Moves ksgen_settings replace lines earlier and adds delay before tempest

Change-Id: I1dc4fd5afbe1111a24116a4df48725970a29db26