Yeah, these things you've mentioned can't be patched.
You're sure? I recently got hit with a teammate's grenade as president and it didn't do damage.
To be honest I've never seen an explosion from a friendly grenade causing any damage, not even to team mates' vehicles. I guess the vehicles are sometimes taking a little damage because they are violently pushed by the blast. That's part of the game physics and nothing can be done about it.
About scripting, there's a callback that is called whenever a vehicle is damaged, but it doesn't report who or what caused the damage. Then we can't tell if it was caused by a friendly explosion or not, so there's no way to prevent the vehicle from taking the damage.