Given the situation, and the need for an inexpensive weapon, I'll ditto the shotgun. Worst case, it IS impressive, more so than a handgun. Note: I'm of the opinion most people should have a personal defensive weapon, so my recommendation is NOT specific to your case. Load it with some form of buckshot, given you're in a shared wall apartment complex. Buckshot, while perfectly capable of penetrating drywall, will at least stop far faster than a rifle/pistol bullet. I wouldn't even go with the classic 00. I'd consider going with #1 or 2 buckshot. If you're concerned about thin walls - even #4 Buck(not bird), has a good stopping rate. Remember: You still have to aim with a shotgun!
Make sure it's a LEGAL shotgun. Read up the self defense rules in your state.
Do NOT threaten the guy with it. The only time you'd use it is if the guy threatens your life. In many states, if he breaks down the door and steps foot inside, THEN you'd be able to shoot him in self defense, for example. Consider this a losing scenario. At the least, you're almost virtually guaranteed to spend time in jail, lose the apartment, and spend lots of money on legal fees.
Choices: Moving is a definite option, as is contacting the renting agency/building owner/cops whenever there's a problem.
Note: This is an internet forum, we have only your words to go on. We don't have details of the apartment, just how nuts the guy is, etc...
Document, Document, Document. A video recorder, even a tap recorder of him assaulting your door(I presume it's your door), is good evidence. Calling 911 when he's pounding on your door is also a good idea - it's documentation at the 911 center, and will have time and impartial witness(the 911 operator).
Heck, you might be able to gather enough to charge him criminally if he says the wrong things while door-banging.