You've attempted to open a compiled script, denoted by the .out or .luac extension, which is why it looks all jumbled up. Is there a .lua version of the script you want to edit in the same folder?
Chris
Just Trains BR 4, 5, 6, 7 and LNER K4 & V2 script and simulation author