When wireless devices communicate with each other, does the WAP have a MAC table and do the packet forwarding itself? In other words, do the data packets travel back and forth to the switch, which reduce the bandwidth to half of the wire's max link speed?
This will depend on the solution in place. An AP has the capability to receive traffic from a client device and forward that traffic to a second device associated with it. However many modern solutions of scale will often tunnel client traffic back to a controller and the controller will then forward that traffic (either back to an AP or to the wired network).
You also have features such as "client isolation" which will prevent an AP (or a controller) from allowing traffic from one wireless client to another. Often these features are more capable when applied at a controller layer rather than at the AP. For example, for client isolation an AP will only know which clients are associated to it and that any other client is "on the wire" whereas a controller generally knows all the clients that are associated to all the APs it manages, allowing client isolation to be much more effective.
However this does not reduce the "bandwidth" to half of the wire's max link speed in any sense unless you calculating the bandwidth as the sum of the max link speed in both directions. For example, if you have a 1Gig link between the AP and the switch, the link is full duplex. That means the AP can transmit a approximately 1Gig to the switch while the switch is transmitting approximately 1Gig to the AP. Even then, it doesn't "halve" the bandwidth as much as it potentially carries each frame two times (once from the AP to the switch and again from the switch back to the AP).
When the WAP sends data packets, does it send unicast to a specific device (like a switch) or broadcast to all devices (like a hub), which also reduces total bandwidth?
It can send both unicast and broadcast frames (just like a switch), but both types of traffic are "broadcast" in the radio sense on the spectrum. Barring MU-MIMO, generally speaking only one device can effectively transmit on specific frequency at a time.
Unicast frames are forwarded to client devices using the client MAC as the receiver address and/or destination address. These will go at the highest data rate that both the client and AP can reliably communicate. If encryption is enabled, the encryption key specific to the client association will be used.
Broadcast frames are forwarded to a broadcast address and will be transmit at the fastest base data rate configured for the wireless network and supported by all clients. This is often far slower than unicast traffic as it needs to be transmitted at a data rate that all clients in the coverage area should be able to receive, so it does reduce "bandwidth" in that less data is sent for the same period of time. If encryption is enabled, the group temporal key is used, which is shared with all clients associated to the AP.