You specify an id if you wish to access the exit again in scripts. If you don't specify an id, one will be generated for you (every object has a unique name/id), and it would be a bit tricky to actually determine what it is. So if you're happy to just create an exit and then leave it from then on, you can leave the id alone. (If you do want to specify your own id, you can use GetUniqueElementName to generate a unique name - be sure to save it for later use!)
The type is the type of exit to create. These are types like "northdirection", "southdirection", "northwestdirection", "indirection", etc. If you specify a type, then you get all the attributes specified in that type, like alt name, alias, etc.
Hope that helps!