Is it possible to add , remove and edit user grants through scripting?
Best to point people at the current documentation:
https://docs.inductiveautomation.com/display/DOC81/system.user
Is User Grants not exposed in scripting yet?
I cannot find it in the section you provided.
This isn't possible right now.
Grants aren't actually part of a user, they belong to a complicated configuration object associated with an IdP.