I can't help with the throwing it part (at least not the config part) but it is possible.
For the spawning objects part, here is some partial/untested/pseudocode to consider to get you started looking in the right direction. Again, this may not be right or the best way, it is a start:
You would need to add an event handler (probably an init EH) to the unit and you should strongly consider using CBA/XEH to make sure you don't conflict with other EHs. The init EH has a condition that checks to see if the unit has a shovel in its inventory. To check for this you would use hasWeapon:
_this hasWeapon "Shovel"
This assumes you give your shovel a class name of "Shovel"...make your actual name unique, use a tag, and try to have inherit for an existing weapon if at all possible.
If the above condition returns true, start another script that checks in a loop to see if the the unit's current weapon is the shovel (not just in inventory) using currretWeapon:
_unit = _this;
while {_unit hasWeapon "Shovel"} do
{
if ((currentWeapon _unit) == "Shovel") then
{
trenchID = _unit addAction ["Dig Trench", "digTrench.sqf"];
MoundID = _unit addAction ["Make Mound", "makeMound.sqf"];
}:
sleep .1;
};
_unit removeAction trenchID;
_unit removeAction MoundID;
Then digTrench.sqf and makeMound.sqf would play the animations and then createVehicle the appropriate objects.
Again, I hope this got you looking in the right direction! Good luck!