There are several things I consider when making such choice (in no particular order):
- does task involve general functionality (plugin) or processing my specific content (develop)
- is there the plugin for the task from known developer and well-maintained (plugin) or there is fractured field of numerous plugins (develop)
- do I want full range of related functionality (plugin) or single specific tweak (develop)
In general I will always do at least quick search through plugins to assess how likely it is to get task done with them.
There is no rule of a thumb here. I both use plugins for tasks that can be easily coded (for example page titles) and coded from scratch some really beaten things (for example anti-spam protection).