If It were mine I would use just a little bit of Velcro to hold it down if it was staying in place when I fold it up. The interlocking pieces by themselves will hold the pieces together.
I didn't use the foam on the bunk ends I only have it on the main floor and absolutely love it.
I bought the 5/8" thick in red oak and it's great on your feet, never cold, very quiet .
2010 Jayco Hybrid EXP21M
2013 Toureg TDI