You were hurt and Derek wanted to help you so he took some of the pain away, turning his veins black as your pain surged through them. It worked and you were able to relax enough to fall asleep.
"i love you.. derek." - you
"i love you. You're gonna be okay." - Derek
After you fell asleep Derek stayed by your side the entire not. He didn't want to leave you again, not after what happened.