As some of you, I felt like James's flirt was more for the funny side than anything but I can understand that it's annoying when your Shepard isn't the type.
To me, it felt pretty natural because I always think Margaret's relationships with men this way: a lot of tease and it works or not but nobody will cry a river about it; in general, she didn't do this on the job but if the guy wants to play, she is game. I'd already roleplay this with Kaidan, back in ME1, and she ended up caught at her own game but it never meant that it was going to stop, hell, Kaidan always makes comments about how the other women are beautiful, it would be hypocritical from him to get jealous about it. So, she teases James for the laugh, trying to get him embarrassed, she likes to be "the annoying little person", espeschially when he plays cards with others people.
Plus, I never interpreted the comment about the bed as an invitation, Maleshep does it too. I took it as an answer to "Everything is a little...too soft". And Shepard's reaction made me laugh, like "Return to your sleeping pod, boy, it a no-go zone for you".
I couldn't find any concrete information about what happened on Akuze and as far as I know, the time lapse was never discussed. I wanted Devi to experience something that was long lasting and isolating. It wasn't enough to lose 50 Marines and 35 colonists within a few days. Such a tragic loss is not directly related to Devi's decision making throughout the rescue mission (we can blame Cerberus for that). I wanted her experience to be vaguely reminiscent of the time Jesus spent fasting in the desert; which is around 40 days. (Not trying to offend any Christians reading this)
An interesting point, I think

(and I don't see why it would offend Christians, it shows more culture and it is a good thing. And a lot caught religious references in the Mass Effect series, si, it's no harm.)! It remind me of the gift of words given by the Consort about loneliness too.