Clive, Yes you can buy replacement strip. I've just re-sealed the front windows on my 1999 Compass Rallye and so had to remove the strip you mention in order to remove the window seals etc. The strip acts in 2 ways - 1) it is an exact width and fits into the top of the window seal thus causing the bottom of the window seal to 'grip' inwards creating a better seal around the frame opening & 2) it covers all of the staples which help to hold the window seal into the frame. I didn't need to replace the strip on my windows but I did see it in my local caravan accessory shop. As far as I know, it comes in white or grey and possibly in different widths depending on the window seal (there are different window seals for different panel thickness) so just measure the old before buying replacement, which isn't too expensive. As to stopping it coming away in the corners, I'm not sure. I suppose you just need to make sure you don't stretch it when fitting and make sure it is pushed well into the corners. To fit it, it just sits into a narrow groove at either side. I did it from outside with the window open - press one side into position and then use a small screw driver to ease up the rubber at the other side whilst pressing the strip down into position. It's a little bit awkward and just takes a little bit of patience.
NOTE: Before removing the old strip, make pencil marks on the wall where all of the window catch screws go otherwise once the new strip is fitted, you'll struggle to line up the catches properly, as there will be no holes. The 2 ends normally overlap and the join is normally under a bottom window catch. Hope this helps,
Simon