OK, if the USB is DISconnected, the line on the screen is coming via bluetooth, hence the bluetooth is kosher. This is more than can be said for your code, which seems to just flash a LED and send a pointless remark over serial. Junk.
Try the code I posted. It doesn't flash a LED but is probably more useful.