I have been playing around with Google Apps Script today and I am trying to code some custom spreadsheet functions. I have done some searching but cannot find an answer to
Yes, this is perfectly possible. You just need to call SpreadsheetApp.openById and then get the desired sheet and ranges normally.
SpreadsheetApp.openById
Please take a look at the documentation : range.getValues() and range.setValues() are very basic GAS methods and are pretty well described.
range.getValues()
range.setValues()
Read the tutorial as well.