I know you have already accepted an answer but as I said yesterday, there is
no need to use a loop, in fact the number of times you need to use any loop in SQL is very rare - because it is SET based.
A very simple way of producing your output is just to use a series of self-joins...
INSERT INTO @tbl_wordlist
SELECT A.Word + B.Word FROM @tbl_wordlist A
LEFT OUTER JOIN @tbl_wordlist B ON A.Id + 1 = B.Id
WHERE B.Word IS NOT NULL
INSERT INTO @tbl_wordlist
select A.Word + B.Word
from @tbl_wordlist A
LEFT OUTER JOIN @tbl_wordlist B ON A.Id + 5 = B.Id
WHERE B.Word IS NOT NULL
INSERT INTO @tbl_wordlist
select A.Word + B.Word
from @tbl_wordlist A
LEFT OUTER JOIN @tbl_wordlist B ON A.Id + 8 = B.Id
WHERE B.Word IS NOT NULL
There are other and better approaches that could be used, this is just the first one that came to mind.
If this is your homework then your tutor is probably going to start teaching you more about combinations soon, and they are absolutely not going to need you to keep coding loops in SQL (if they do then leave that college!). I got so passionate about loops being used I wrote an article about it -
Processing Loops in SQL Server[
^] - my article only touches the surface of what can be done (what
should be done) in SQL without going anywhere near a conventional "loop" so do do more research.