You've answered your own question. You can only permanently modify files outside your home directory as root
No, this wasnt the problem, i had previously always been able to edit scripts in /usr/bin - and the files were all chmod 777 - further if i didnt have permission, this would not explain why 200 lines of coding would suddenly vanish when i was attempted to make a small change. itd merely refuse to make any changes, not wipe the file.
I managed to find, what i think, was the cause of the problem. The partition where all the system files are held, that is '/' had no space free, as a result of thousands of clientmqueue files, which im confused as to how why they accumulated since the sendmail service was switched off. I was able to write stuff to my home dir, since /home is on a much larger patition with lots of free space. Anyway, after i deleted the files in /var/spool/clientmqueue, i could once again edit scripts fine from my user account (till now im not exactly sure why root was still able to, maybe it was just coincidence that there was some free space when i tried on root, or alike)
So as far as i can understand, anyone who has a similar problem, make sure you check you have sufficient df space.