Combining power input and USB data port for a Raspberry Pi Zero (W)
If you want to use the same USB port as host (delivering power) and node (accepting power), you should use a connector which can act as both, e.g. micro USB. Then you will be able to use the ID pin to determine which way the current will flow on VBUS, as explained here.

Relying on voltage differences between two USB supplies will lead to a situation when your device is connected to a charger which delivers a lower voltage than your BMS, and your device will try to charge the charger as a result.