I believe the way they did it was put companions in a database "DB_Companions" and then check to see if the person initiating the dialog is in that database or not. So something like:
INIT
DB_Companion(CHARACTER_Jahan)
KB
IF
DialogStartRequested(CHARACTER_NPCmayor, _Player)
AND
NOT DB_Companion(_Player)
THEN
Initiate dialog (I forget the call)
IF
DialogStartRequested(CHARACTER_NPCmayor, _Player)
AND
DB_Companion(_Player)
THEN
Initiate companion berating dialog.