But why bitcoin-cli stop && sleep 5 && bitcoind
This doesn't make sense.
The uacomment can only take effect after bitcoind has been restarted. The bitcoin-cli stop tells bitcoind to stop. The sleep 5 is to wait 5 seconds for bitcoind to actually shut down, and bitcoind is for starting bitcoind again.
However you are not using bitcoind so this won't work for you. Just do the first command, stop Bitcoin Core from the GUI, and launch it again once it is fully shut down.
How can I check if the BIP 148 support signal was correctly set?
In Bitcoin Core, go to Help > Debug Window and you will see a field for the User Agent. From there you can see that the User Agent Comment has been set to support BIP 148. Note that this does not mean that you are actually supporting BIP 148 and will enforce its rules. You are merely saying that you will support it before the activation deadline of August 1st.