The router will work fine for positioning the dispensing head. No reason that would not have control over the Z axis. Sending the signal to trigger the dispenser should be no problem, you should be able to use any of several M code commands to send send the signal.
The sequence would be:
Move X & Y to position
Move Z to position
Send dispenser activate signal (M7 maybe?)
Dwell while dispensing
Retract Z
Move X & Y to new position.
I don't know anything about grbl so I can't help you there. I have built several dispenser systems, one using a router table.