How can I get a hand sanitizer solution to form a gel?
According to the wikipedia article on hand sanitizers, polyacrylic acid and polyethelyne glycol are commonly used thickeners.

You could try any hydrophilic polymer if those aren't available. Cornstarch might even work if you dissolved it in the alcohol before adding the other ingredients.