Is there a way that the blackfin software can detect if the JTAG debugger is connected?
There isn't, unfortunately. The reason being that when you are executing something on the processor you have exited the emulation mode. You would enter an emulation mode only when you stop (if halted through the emulator) i.e. on an emulation event.
The IPEND register to determine which mode you are in (user,supervisor, emulation). If IPEND is set then you would know you are in emulation but it will always be reset once you start running your program, so it's not really useful for detecting anything in your code!
A hardware solution could be possible - tying a GPIO to the JTAG header and monitoring that signal. When the Emulator header is attached, the voltage would change the state of the GPIO, and you could take action. But, there's certainly no in-built software solution for detecting this, unfortunately.
Retrieving data ...