On the first one, you got coolered, so it's inevitable that you were going to take a hit. Two flushes is unusual, of course, but it happens - and the 2nd best hand gets bitten. Since you were out of position, checking either the turn or river might have saved you one of those bets. It's unlikely that he would have checked the turn along with you, since he bet the flop. But if you check-call the turn, then check on the river, he might think you're slow playing the nut flush and checked it down, saving you the last bet.
Was it 6 handed or 9/10 handed? Either way, your villain raising from early position with J2s is highly questionable. Was he a novice that that played any two cards simply because they were suited, or was he a skilled player that was planning to outplay everyone post flop? If he was a novice, then he probably wasn't thinking about what you had and would have kept firing bets. If he was skilled, he may have put you on a flush draw and slowed down when the 3rd diamond hit, worried that you had the K or Q of diamonds. I'm guessing he's a novice, because even the most skilled player is not going to try to outplay a loose table with that hand from that position.
On the second one, I'm a little confused on the preflop betting. Did you limp preflop, then have the BB raise you, and you called? Someone may need to correct my math - but since you have 12 outs and you'll see 2 cards with you all-in bet, you have approximately 48% chance to win. Your call is $100 to win $242, or 41%. If you factor in the remaining $20 you have left, you're betting $120 to win $282, or 43% (the overbets sometimes throw me, so forgive me if my math is jacked up). If I'm figuring this correctly, your play was mathematically correct.
However, since you did not plan to continue playing if you lost, the prudent thing to do is fold and wait for a better opportunity. You're still looking for a shot to double up, but with 24 big blinds left, you have time to get all your chips in when you are ahead, rather than on a draw.