Can this also mean metaphorically "I will stand by my friend," like in a time of stress or crisis?
‘My friend’ can imply ‘the friend I mentioned’ (e.g. החבר שלי), and while in common, spoken Hebrew this interpretation is fine, it’s not the case in more formal registers.. A more accurate way to translate it would be ‘a friend of mine’.
You're right - חבר שלי instead of החבר שלי is colloquial. But it's common and should be accepted in my opinion.