var mytext = "This is some text at the start @station@ some text in between @station@ and some text at the end.";
var msg = mytext.replace("@station@", station.displayName);
log(this.name, "result = " + msg);
The JS replace function is really supposed to take a regex, rather than a string. You can use strings, but you lose a lot of the power of the replace function - like global replacement
var mytext = "This is some text at the start [station] some text in between [station] and some text at the end.";
var msg = expandDescription(mytext, { station: station.displayName });
If you have more than one replacement to do, this is probably easier, because you can do it all in one function call.
var mytext = "This is some text at the start @station@ some text in between @station@ and some text at the end.";
var msg = mytext.replace(/@station@/g, S.mainStation.displayName);
log(this.name, "result = " + msg);