In these 2 sentences does 得 have the same function?
Is this 得 doing the same job in both sentences?


Yes. Both 得 are 'verb particle'

In both sentences, 得 are following a verb. It is a [verb particle] of the verb before it.


  '漂亮而迷人' is the 'result/ degree' of the action '把自己梳理'
  
  [把自己梳理] is the [verb phrase]; [得] is a [verb particle] (*used to express possibility or capability; to indicate the result or degree. Similar to English 'to' / 'to the point of' *)
  
  [漂亮而迷人] here is an [adjective phrase]. It is the[result/degree] of the verb phrase [把自己梳理]. 


~


  '生病' is the result/ degree of '忧郁'
  
  [忧郁] is the main verb; [得] is a [verb particle] (*used to express possibility or capability; to indicate the result or degree. Similar to English 'to' / 'to the point of' *)
  
  [生病] is the auxiliary verb. It is the [result/degree] caused by the main verb [忧郁].