So I figured this out: the error message had nothing to do with the line in the config file, but everything to do with the name of the config file instead.
I separated out all of my custom eshell configurations into a file called eshell.el This made emacs skip the eshel.elc from my instillation on startup, because emacs looks in the user's custom directory first and uses the file that is there instead if it has the same name. So changing the filename to my_ehsell.el magically fixed this problem.
As to the proper way to define that variable, that is best answered in this question: Difference between `set`, `setq`, and `setf` in Common Lisp?