Humor should flow naturally if it's there. That's a facile thing to say, but I also think the first try at humor may not.
If you feel a joke should work, but you're not sure, it's valid to kick it over the wall to your testers and ask them what it needs to make it better. Especially if a joke is potentially risky--you want your testers to find it before the crowd does. Even comedians try new jokes out before a smaller audience before sharing with larger ones.
You also want to avoid jokes that've been done before, and I always find I need to re-read jokes to see if they're still funny the next day. I've found jokes that misfired because they were a bit too snarky, or even when they prompted a user to a verb which gave an annoying default response.
A good joke specific to text adventures may be one that hints another way to do things, if a good one works, or even if you are completely on the wrong track. Or it might give a different warning the second/Xth time someone tries something (remember the "something stinks around here and it's not just your puzzle-solving ability" from H2G2?)
You don't have to get big laughs, only consistent and satisfying ones.