Intercom Help

Hello, and thanks to all for the very helpful information. I have a FreePBX setup using all Linksys SPA941 phones. I recently added the feature that if you dial a 2 before the extension number it will automatically go to that persons intercom on the phone. The problem I am having, is if the extension is already on another call, when you intercom to that person, the other party is automatically put on hold and the intercom overides the call. I would like to add into the dial plan logic that first checks to see if that extension is in use, and if so, default back to dialing the extension # without the 2 or to give the congestion tone. Can anyone help with this? Thanks!