I've had JB4 and others with various BMW's over the years.
I don't believe it can be detected.
In many cases, the dealer knew it was there.
There's a couple of things to consider:
1. BMW mechanics are busy and want to get your car out of there as soon as possible, so they aren't going to plug your car into a scanner and go looking for a JB4. They might look for a tune on a 140.
2. You can remove it, before going in for a service.
3. If you have / get a check engine light or something like that, have your car towed to a place where you can totally remove all evidence of the JB4.
It's a risk, but so is life - if you want it, get it.