You need to ask yourself what degree of security you really need.
A request your script makes to check the validity of a license could be intercepted, and redirected to a malicious server that always returns "ok", with not too much effort, so to make 100% sure you would have to start encrypting your communication, which in turn could be cracked by an expert etc. etc.....
In most cases, though, if you serve to end users and companies that can't afford the risk of cracking things, the protection you describe should be sufficient. Just make sure you disclose that the script needs to connect to your server to work.
Obfuscation will work too, however it will be very easy to remove the license check from a script that is merely obfuscated.
Also, most shared hosting setups won't allow for IonCube encoded scripts to run. See Clement's very good answer for details.
Personal opinion
Having to install Ioncube would be a major turn-off to buy a script for me. It would have to be really, really good, unique and worth the hassle, and I would have to trust both your code quality (as I'd have no chance to fix bugs) and the likelihood that you won't go out of business anytime soon (so you can provide me with updates without which the product will become useless after a few years).
If that's not the case, I'd look for alternatives that ship with source, even though they are more expensive than yours. I'd think long and hard whether it is really necessary to encode the script. I am a believer in shipping with source and scaring the customer off unlicensed copying using an agreement with a breach penalty.
Just my 2 cents.