(See the best response by Flame Guardian.)
So I was working on my map placed a few turfs down compiled then went afk. Came back to this error
I went to edit the map file with notepad to find out what it was and came across this
The map was there a way I could fix this or is it gone forever. Also is there a way I can avoid this issue in the future?

Best response
Always always always back up your sources. Work and sometimes full source codes can be lost if you neglect to do so.

I backup a new copy of my source after every work session and before updating to a new version of BYOND.

I also backup said sources on two separate hard drives once a week.

Perhaps someone else can enlighten you on how to fix your corrupted map file or if it's even corrupted at all. Otherwise, you could explore the option of using windows restore points to rewind your computer to a time that your map was intact. This option may not be worthwhile though if you don't have any recent restore points. windows-back-up-restore
Yeah I tried to go back to a restore point and found that the feature was turned off. Yeah I guess i'll just have to back my files up more often. Wish I knew what caused it though. Thanks for the help.
You could try to see if there is a shadow copy - sometimes that's on without backups. Go to the folder where the file was. Right click. Properties. There should be a "Previous Versions" tab. See if there's anything in there.
On top of what SSX said, I believe BYOND also sometimes just straight up makes backups for you. Like a backup folder in your project library.

I never understood how and when that happens but I'd take a look for it anyway. Once again, it'd be in the same folder as the map file and the folder would be labeled something like "backup".
Map backups are created when you try to load a map and it fails due to compilation issues.
I really recommend that you setup git or some other version control for your projects. Copying and pasting and making your own backups is messy and confusing. Look up git or subversion or perforce and use one of those.