Well, the most obvious thought is that you're not using XQuartz at all.
do shell script is a standard AppleScript command that executes a shell command in its own environment - that is, it does not depend on any other application to execute. The fact that you've wrapped this in a 'tell application "XQuartz" block is irrelevant - XQuartz never gets to see the command.
From what I recall XQuartz has very limited AppleScript integration (maybe even none), so any interaction may have to be via UI events (e.g. simulating typing the relevant command).