A basic ID could involve a trigger. Simply place a trigger over the area of how it can be triggered (covering a road etc) and then put the code below in the activation field. Any unit that wonders in would get a nasty blast.
change obj1 at the end to an object at the side of the road. If you want it to be invisible you can use a game logic object and name it obj1.
ied1 = "Bo_GBU12_LGB" createvehicle getpos obj1
You will also need to set the activation to whichever side you want to be able to trigger it.
You can change the "Bo_GBU12_LGB" part to a smaller explosion if you wish. Visit
this list and look at the 'Ammo Classname' column. Play around with the artillery, grenades etc to get your desired effect.
For your second part you can use another trigger. Make it cover the whole area where the enemy might go. Set it activation to the enemy side and click the box saying 'not present'. When there is 0 enemy left in this trigger you can have it end. Do this by using the following code in the activation field.
hint "Mission Complete!"; endMission "END1";
Good Luck!