How to dynamically pull to ground USB D+/-
As described by the FAN3989 data sheet, FLAG1 high means:

If a charger is plugged into the USB port (D+ and D- shorted), the voltage divider of 1M and 5M put a voltage of 2.3V on the D+D- inputs and flag1 is HIGH, indicating a charger is connected to port.

While FLAG1 low means:

If the USB port is connected to a standard USB device, the D+ input is pulled up to VDD and is in parallel with the 1.5KΩ on a USB transceiver with a parallel R value of 1.497KΩ. The D- input is connected to a 15KΩ pull-down by the USB device and in parallel with 5MΩ with a parallel R value of 14.955KΩ. This condition forces flag1 LOW. If D+ and D- are open (floating), D+ is pulled to VDD and D- floats LOW, which forces flag1 LOW.

So if you have a standard USB device and not a USB Charger, then Flag1 will always be low regardless if the usb device is connected or if the usb device is unconnected. It's unlikely you can modify the connection without interfering with the USB connection. The FAN3989 is not meant to flag between standard device and unconnected.
Assuming you have a usb charger plugged in, you will need to implement a usb switch between the device and the FAN3989. The input of which would be tied into VUSB/5V after the S1 switch. This would disconnect the D+ and D- lines, leaving them floating, so that the FLAG1 goes low.
If you have a usb transceiver, then look at page 8 of the data sheet for how it works.