Correct (sort of. Lets clean those thoughts up a bit. They were good, I just want to make sure you think of it 'this' way.)
A variable is basically a "container" of sorts. A function is a set of processes and returns a value --A procedure--. When you define a variable you are essentially associating a name that identifies a variable which has a value.
You define a name by using "setq".
-e.g. (setq a 1)
We have just named the value "1" to the name "a".
So theoretically, we can test a value and perform a process --or set of processes-- based on the results.
Taking the information we have just learned, let's create a function that returns a True/False value. We are going to create a procedure that will return either True or False based on the value of a test. Side note: This procedure will be a procedure you can use over and over again in many programs you create over the years so you should keep track of this procedure. (I have a system that seems to work for me. I keep a file I call my "Utils" file that holds all my finished products and I also keep a "Junk" file for my daily program scratchings. I suggest devising a system of your own and sticking to it.)
I'll start with an easy one so I don't loose you sofar. How about a function to test to see if a layer exists in the drawing?
Start a new drawing and run this line of code in either the command line or the VLIDE and see what it returns.
(tblsearch "layer" "0")
What does it return? How do you think we can make a procedure return either true or false using this function? HINT: Find a function that will return True or False. -e.g. Daron used the "or" function earlier, what task does it preform?