30 day visitor -> 3 months student

Hi,
I did some search on the web but didn’t quite find what I was looking for. So I will ask my question here. Sorry if it has been asked and answered already.

My situation:
I am a Korean student studying in Canada. My university runs on a trimestrial basis. In the summer trimester(May-August) I plan to study in Taiwan.
The Mandarin schools seem to offer a three-month summer program(June-August). Since I have four months, I want to make the most out of it. Korean citizens get 30-day visa exempt. So what I would like to do is:

  1. Obtain a student visa(here in Canada).
  2. Go to Taiwan in May as a visitor, spend a month travelling there.
  3. At the end of May, go to Korea to visit my family for a week, and then return to Taiwan in June for my 3-month studies.

Is this possible(and legal)? It seems that it would be possible, but I don’t want to risk anything, so just to be sure.
Thanks in advance.

Come to think of it, I could get my student visa IN Korea instead of in Canada. Would this be preferable?
It would be applying for a visa just a few days before the classes, but since they say it takes only two to three days…

Yes get ur visa in Korea sounds like the plan. The first trip just use your visa free entry. Sure its still only 30 days? Japanese get 90 days and Singaporeans too.