The short answer is, and I'm not trying to be an asshole, that you are thoroughly screwed. There is nothing worse than being handed code that was shoddily written by an untalented hack of a consultant. It is a huge mistake for companies to hire random people without any regard for their talent level and then dump the maintenance onto some unwitting internal developer. The code that the consultant hands over may mostly work for a very specific task, but it will probably be extremely difficult to extend, and god forbid you should ever have to debug 8000 lines worth of spaghetti.
Many of the skills that are essential to being a good software engineer, and that go largely uncovered in school, involve social interactions. More than anything else, you have to be honest, and you have to rein in the unreasonable, illogical expectations of managers. Do not let managers make unreasonable promises, and do not make grandiose claims about how you'll learn four new languages, debug 8000 lines of code, and cure both AIDS and World Hunger in two months. When you fail, you'll look foolish, your manager will look foolish, and the clients will be hung out to dry.
Sometimes when you are handed a true monstrosity, it is better to glean what info you can from it, and then burn it to the ground and start over again. Given your gruesome description of the task at hand, I think that you should seriously consider this course of action.