Sorry, it does not have a lot of information.
The loose wire, when grounded making the doorbell function is unlikely to be the culprit. I suspect it came loose when you took things apart.
Take a close look at the alarm mechanism box and post the part number.
Certified Senior Electronic Technician, Telecommunications Engineer, Telecommunications repair Service Center Owner, Original owner HR 2008