The fact that you can browse the directory tree means you are successfully communicating with the camera.
The intermittent error with capmode is very strange, I don't know what to think about that.
I don't know if mode switching while connected to USB has ever been tested on S2IS, it's possible it doesn't work.
To narrow down exactly where the problem occurs, you can call individual lua functions on the camera from the console. For example, you can try:
=return os.stat('A/CHDK/LUALIB/GEN/MODELIST.LUA')
the result should be a table if the camera is able to access the file.
You could also do
=return require'gen/modelist'
which should return a table with all the known CHDK modes, indicating the file was read OK.
You can try to switch to record mode using
=switch_mode_usb(1)
this doesn't require capmode or modelist.
Note when you plug the camera into USB, the mode switch should probably be in the 'play' position.
If I close chdkptp and give it a new try, it says a script is running for every button i press.
This indicates that some previous script never completed. If you can identify exactly which call failed to end, that might be helpful.