The SetMessage script is the one you want to use to display the message. Combine that with a player interact callback, and you should get the result you want.
First, set the callback in OnStart()
SetEntityPlayerInteractCallback("Door", "MyFuncName", false);
Note: If you want this to happen only once, set the false to be true.
Next, set up the callback event:
void MyFuncName(string &in asEntity)
{
SetMessage("MessageCategory", "MessageEntry", -1.0f);
}
Here, the MessageCategory refers to a category in your extra_english.lang file. The MessageEntry refers to an entry within that category. The last float number determines how long it should last (but I've set it to auto).
Lastly you need your lang file to respect this. If you haven't worked much with your lang file, this may be a bit tricky, but you need to add the category and entry you specified.
<CATEGORY Name="MessageCategory">
<Entry Name="MessageEntry">This door requires a key</Entry>
</CATEGORY>