Hi,
At the end of the day you just need to do what's best for you- everyone is different.
It's great that you're reaching out for help and guidance on here. perhaps try creating a pros and cons list to see whether commuting or staying in halls would be easier? Although commuting may be easier and more cost effective, it might be more difficult when it comes to getting into university and making friends and socialising. These are just some things to take into account.
If you are sure that commuting is what you want to do, 30-40 minutes should be fine. I know some people who commute two hours each way, and although it's tiring for them, its worked out cheaper and they feel more comfortable staying at home.
Hope this helps.
Josh
(LJMU Student Ambassador)