I meant, wouldn't you have it as:
getself.Hide;
repeat
Wait(100);
until(IsFkeyDown(Q));
getself.Show;
To have it continuing to hide itself without being shown could cause errors (I think). Also, wouldn't it be more useful to return the time it ran until it was stopped?
Edit: Played with it and got this (changed it to what I said):
function HideUntilKey(Key: byte): Integer;
var
sTime: Integer;
begin
sTime:= GetSystemTime;
getself.Hide;
repeat
Wait(100);
until(IsFkeyDown(Key));
getself.Show;
Result := GetSystemTime-sTime;
end;
It works fine for me (using key without setting up a variable to store it) and it outputs the time it hid for.