your document runs without error for me and produces a diagonal line. just using luamplib from texlive 2016 (with luatex 1.01, but I don't think that's making any difference here)
- [luatex] luamplib and Paragraph ended before \mplibdoreplac... Maxime Chupin
- Re: [luatex] luamplib and Paragraph ended before \mpli... David Carlisle
- Re: [luatex] luamplib and Paragraph ended before \... David Carlisle
- Re: [luatex] luamplib and Paragraph ended befo... David Carlisle
- Re: [luatex] luamplib and Paragraph ended ... Maxime Chupin
