I agree the petition is more about a gesture, but we have banned other public figures from the UK for the same sort of speech.
The Home Office has powers to ban individuals from overseas coming to the UK under the '^unacceptable behaviours or extremism exclusion policy^'. Last year Home Secretary Theresa May said she had excluded hundreds of people because she considers their presence is "^not conducive to the public good or if their exclusion is justified on public policy grounds^".
People banned from entering the UK under the exclusion policy in the last few years include leaders of the Westboro Baptist Church, Islamist preachers and Ku Klux Klan officials, and two anti-Muslim bloggers.
The part of the petition that I think is most relevant is -
If the United Kingdom is to continue applying the 'unacceptable behaviour' criteria to those who wish to enter its borders, it must be fairly applied to the rich as well as poor, and the weak as well as powerful.
Free speech in the UK comes with a number of exceptions including threatening, abusive or insulting words or behavior intending or likely to cause harassment, alarm or distress or cause a breach of the peace (which has been used to prohibit racist speech).
Of course, this is all hypothetical because who knows when Trump will be returning to the UK, but the petition will send him a message.