Hello, Eric. It looks like I am a couple years late in finding your question, but I may have some information (if not a solution) in the event that you're still interested.
First of all, your program is correct, as best I can tell, and it runs fine in Apple Pascal v1.3 on my Apple IIc (with or without the swapping directive). According to the Apple Pascal Language Reference Manual, the error 58 you are getting is "Error in factor (bad expression)" for whatever that is worth.
I don't have an Apple IIe, but if I run the same program in the linapple emulator, then I also have to turn swapping on to compile the program, and it also fails. When swapping is on, it errors on the END statement as well, but with an error 20 ('.' expected) even though the program does end with a period. If I turn on super-swapping with {$S++}, then I get error 168 (Undefined label) on the same line.
The truth is that I have had problems with v1.3 on the linapple emulator in my own experience with small and relatively large Pascal programs. Until I saw the issue you were having, I thought that the problem was likely a bug in the emulator. Now, I am not so sure.
If you're up for trying again, I'd suggest you try Apple Pascal v1.2 on your machine. I have had much better luck with this version on linapple. For my own code, I test as I go on v1.2 on linapple, and then when I am happy with the program, I transfer it to a floppy and compile it on v1.3 on my IIc.
Best of luck,
den