Espionage teams on their own colony are 'defending' against enemy espionage teams on that colony, even if there aren't actually any there -- the same way that ground units are 'suppressing unrest' any time they're on a colony, even if there is no unrest to suppress. In either case, there isn't a specific 'defend this colony' or 'suppress unrest' mision to which they need to be assigned.
You're right that 'defending' Espionage teams don't actually roll for skill-ups unless there is an enemy team present -- in fact, I believe they were changed to improve like Survey teams, and every member gets +1% Espionage bonus when the team successfully thwarts or captures an enemy team.
Diplomacy teams on the Capital likewise default to. . . um. . . okay, I forget exactly what it is they default do at the Capital colony (and don't do at any other colony), but I remember them doing it.