I wrote a little script located on:
http://www.netztechnik.at/download/sme8/howto/knowledgeTree/inst-kt.sh
I think this is not the best solution, although it allows for a quick and easy installation it also does not show the user what it does or where it might go wrong. I agree with Stefano that a instruction in the wiki is preferable, IMHO even as a step by step instruction.
Please test it on your own risk and feel free to give me feedback to make it better.
I think the permissions for the configuration files and /opt/knowledgeTree/var can be more restrictive as setting them world writeable is never a good thing, I think this:
# change permissions
chown -R www.www /opt/knowledgeTree
chmod 777 /opt/knowledgeTree/config/config.ini
chmod 777 -R /opt/knowledgeTree/var
should also work with 755, perhaps even with 644.
I also wonder why you are creating a separate user for your script with such broad permissions (effectively a user with all privileges on all databases), if you are to do so you might as well use the mysql root account.
Please keep in mind that when scripting things, actions in the script should be controlled very well and permissions should be set to minimum required values IMHO.
That said, I think it is a good thing that someone took the time to work through installing KnowledgeTree and giving back to the community.