I currently have my project stored on my laptop but I also occasionally want to work on it on my desktop. (Both have Xcode installed). If I connect my laptop to my desktop so that I can access my laptop's files from my desktop, is it safe to simply open the files and edit, or are there hidden files deep in my computer that will get messed up? If this isn't a good idea, are there ways to work on Xcode projects from another computer?
If I connect my laptop to my desktop so that I can access my laptop's files from my desktop, is it safe to simply open the files and edit
Yes. But I don't know what you mean by "open the files". The only thing you should ever open from the Finder is the Xcode project. That being said, there's absolutely no bar to opening an Xcode project located on another volume. (I do it all the time.)
Moreover, a project folder is usually a self-contained world, so there's no issue with copying the whole folder to another machine, working on it there, and copying it back.
Still, the soundest and simplest approach (as long as you'll always have Internet access) is to get yourself a remote git repository and use it to synchronize the work done on different machines. That way, you avoid the "connect my laptop to my desktop" part of the story entirely.