Generally, it's used as a highlight in the conversation.
You can omit "말이야". It's a kind of two different sentences.
" 지연이 (말이야), 이번 여름에 유럽으로 배낭여행 간다더라."
(You know what, Jiyeon is going to go backpacking to Europe this summer.)
" 내 말은 (말이야), 서진이가 우릴 생일파티에 초대했다는 거야. "
(I mean, Seojin invited us to his birthday party)
Meanwhile, in this case, you cannot omit it in the sentence. They're all single sentence.
" 딸기 케이크가 정말 맛있단 말이야.
( You know, the strawberry cake is really delicious! )
" 그냥 집에 있을래. 정말 피곤하단 말이야. "
(I'll just stay at home. You know, I'm so tired.)