"Is this sentence correct grammatically? 以前我没有喜欢整理房间。"
Almost. One extra character is needed: 以前我没有喜欢过整理房间。Because you used 没有 instead of 不, you're saying "In the past, I haven't ever liked cleaning rooms" instead of "In the past, I didn't like cleaning rooms"; thus, a 过 is needed to grammatically fit with the 没有 used.
"What is the difference between these answers? 老师的问题你懂了吗？
There is no difference. Both are acceptable and mean the same thing: "I listened carefully, but I didn't understand." The second answer is simply Chinese condensing itself to be as short as possible out of habit. It's similar to how the 的 is sometimes omitted (for example: 我爸爸是老师 instead of 我的爸爸是老师) or how the number and measure word are sometimes omitted (for example: 这鸟太小了 instead of 这一只鸟太小了).
I hope I've answered your questions. Please let me know if I haven't.