Ok, you will need to use a 'fired' eventhandler:
this addEventHandler ["fired",{(nearestObject [_this select 0,_this select 4]) exec "bomb.sqs"}]
The script (bomb.sqs) will need this
@isNull _this
'_this' is the name of the projectile, so in your case it will be the handgrenade or smoke grenade
So, what you need is to find out the x,y,z of _this before it detonates (before it ceases to exist basically).
So, after the 'bomb.sqs' is called, I think you need to add a delay (whilst the projectile is in flight), and then use:
hint format ["%1", getpos _this]
...before you use the 'isNull' command.
I think that's it. You could try finding out whether or not you can obtain the coordinates after the detonation.
Syntax not guaranteed.
Hope this helps
Gruntage
EDIT: This method is no good for very fast projectiles like tank shells, but good for slow moving bombs or grenades.