If the "terrible code" works fine, then yes. Automated tests will play a key role in this case. If you have a good architecture and can "sandbox" your workaround, keeping it from spreading, the risks of doing this might be less than missing the deadline.
It's very importat that you do not create dependencies on code you know is bad. After the deadline you should come back and cleanup the mess (if at all possible).
It's an illusion to think you will always write good code. Actually, for me, good code is the one you can improve over time. But again, for this, you have to write tests.