You have to set a flag on the player when the dialog starts if the player has the desired level. The best place to do this is
https://docs.larian.game/Osiris/Shared/Proc_DialogFlagSetupSo define that proc for your dialog with the number of speakers your dialog has (probably two: the NPC and the player)
twice:
* in the first one, always clear the flag on the player indicating that they have the desired level (to get rid of potential left-overs from starting the dialog last time)
* in the second one, set the flag if the player has the desired level (use
https://docs.larian.game/Osiris/API/CharacterGetLevel on the second speaker to check this)