I finally found a solution that works, so I'm posting it in case someone else finds this thread in the future.
dt = Data Table("Untitled");
Try(test = LogCapture(dt << save));
If(Contains(test, "problem"),
New Window("Error",
<<modal,
Text Box("The document is read-only")
);
Stop();
)
If the table is read-only and can not be locked, test will become
test = "
I/O problem.
File not open in Write mode.
";
hence why the Contains(test, "problem") works.