Yes, the script exitheart:
#include "k_inc_debug"
void main() {
if (GetIsObjectValid(GetObjectByTag("jolee", 0)) == FALSE && GetIsObjectValid(GetObjectByTag("juhani", 0)) == FALSE && GetGlobalNumber("G_FinalChoice") == 1)
{
Db_PostString("start conv", 5, 5, 1.0);
if (GetIsObjectValid(GetObjectByTag("bastila", 0)) == TRUE)
{
Db_PostString("bast valid", 5, 6, 1.0);
}
else
{
Db_PostString("bast not valid", 5, 6, 1.0);
}
AssignCommand(GetObjectByTag("bastila", 0), ClearAllActions());
DelayCommand(0.5, AssignCommand(GetObjectByTag("bastila", 0), ActionStartConversation(GetFirstPC(), "unk44_exittrig", FALSE, 0, TRUE)));
DelayCommand(1.0, DestroyObject(OBJECT_SELF));
}
}
I just modified this script last week for the next version of K1CP, which you may wish to use as a basis - https://github.com/KOTORCommunityPatches/K1_Community_Patch/blob/master/Source/exitheart.nss All you'd need to do is remove the check for Juhani.
This was a failure on Bioware's part to toggle SetLightsaberPowered back off. I also dealt with this in the K1CP versions of the scene's scripts. Look at the "see also" list in the above link.
The computer's OnUsed script (k_punk_comptalk) gates the DLG to prevent its conversation firing before the showdown with Bastila is resolved. The DS route is another simple GetIsObjectValid check. The version you attached won't decompile, so I can't tell what's wrong with it. You need to provide the source (NSS).