The answer is easy: llDetectedKey(0) has a meaningful value only in detection events like touch*() or sensor() but NOT in a listen() event.
integer CHANNEL = 42;
list MENU_MAIN = ["website1", "website2"];
key AVATAR;
integer HANDLE;
default {
state_entry() {
// llListen(CHANNEL, "", NULL_KEY, ""

; // Please, remove that ugly thing!
}
touch_start(integer total_number)
{
AVATAR = llDetectedKey(0);
HANDLE = llListen(CHANNEL, "", AVATAR, ""

; // Better this way.
llDialog(AVATAR, "What do you want to access?", MENU_MAIN, CHANNEL);
llSetTimerEvent(30.0); // 30 seconds timeout.
}
listen(integer channel, string name, key id, string message)
{
llTimerEvent(0.0); // Disable the timeout.
llListenRemove(HANDLE); // Stop listening.
if (message == "website1"
llLoadURL(AVATAR, "Link to..", "www.bbc.co.uk"

;
else if (message == "website2"
llLoadURL(AVATAR, "Link to..", "www.testsite.co.uk"

;
}
timer()
{
llTimerEvent(0.0); // Disable the timeout.
llListenRemove(HANDLE); // Stop listening.
llInstantMessage(AVATAR, "Time out! The dialog is disabled."

;
}
}