This is a one-trick. It could work the first time, provided the employer wants to keep you. The second time, this won't work anymore and any leaving threats will be considered empty.
Regarding ethics, there is nothing wrong with looking for a better opportunity at any point of your career. Looking for jobs is a perfecty normal activity. However consider the amount of time involved : several interviews that you will have to prepare, several interviewers, process downtime ... Your idea looks like a huge amount of time invested for a very uncertain amount of return.
Finally please consider the risk of coming to your boss and saying "Boss, company Y offered me 10-15% more, I haven't even worked a year, raise me." If you are not critical, the boss could just say "OK, please leave and thanks for your 6 months".
If you really feel underpaid, start with a benchmark of your colleagues and the market as a negotiation basis. This will take way less time, while being perfectly ethical.