Hi there - that might work but you might have to do it again every time you upgrade. That's why changing the core files is discouraged. But luckily MODX has been designed in a way that you never need to do that!
The better way to handle a modx install in a subfolder is to amend the RewriteBase line in your .htaccess file:
# Friendly URLs Part
RewriteEngine On
RewriteBase /~batterup
Now all your urls will be relative to the /~batterup folder.