I believe your Elantra has a switch under the hood which detects if it is latched or not. All of the doors, trunk lid/rear hatch, and hood must be closed or the "beep" will not occur. Since you stated the hood was somewhat smashed, it may not be "closing" the switch telling it the hood is down. In other words, your car's security system may be operating exactly as it should be if it believes the hood is still open. This is normal behavior when something is ajar to alert you to the possibility.
Raise your hood and look for a plunger which would be activated when the hood is down. This should be up front near to the passenger side of the vehicle. Here is an image where I believe it's at (very near where it's at on my 2008 Azera).
NOTE: This is the underhood of an '06 Elantra ... I believe the '07 is the same, but am unsure. If it's different, I'll bet the plunger is somewhere near this same area.
To check if my theory is what's going on, do the following:
- Lift the hood up and support it.
- Ensure all of the doors and trunk lid are closed.
- Push down on the plunger.
- Attempt to lock the doors and see if the "beep" occurs.
If it occurs, you know this is your issue. As soon as you get the parts replaced or fixed, everything should be right as rain. I really doubt the horn is broken because if your Elantra is like my Azera, it doesn't use the horn, but some other thing to make the beep ... could be that the beeper is broken, but I'm doubting that as well.