When you use APPL(EXEC), the dataset is only active for that application. For example, if you have split the screen and issue ALTLIB in screen 1, it will not work in screen 2. I am not sure, but it could be that you loose the altlib when you navigate to a different application in the same screen.
Use the SYSTEM(EXEC) parameter instead of APPL(EXEC).
When you use TSO EXEC ..., you leave the editor before execution of your rexx program, so the edit macro statements will not work.