Plugin PHP write permissions

You will never be able to guarantee this functionality. Filesystem level permissions are ultimately beyond the power of PHP, and thus, WordPress. Though you can try and it may work on some systems/configurations there is no way to guarantee it and nothing you can do if the system will not allow you to change permissions. Why do you think WordPress doesn’t just change the permissions on the .htaccess file rather than issue a warning that the file is not writable by the server?

Saving to the “uploads” directory would be your best bet, but that is most likely going to be an illogical place for your file.

My advise is to refactor the code and use options, or post meta, or something that you can depend up.