Figured out a way to do it. Not sure if it's the best way, but it's all I can think of:
I pick a random number from 0 to the file's number of lines, then loop from 0 to that number and use the "get_line()" function each time. This brings the cursor to the start of the desired line;
for i in range(0, randi() % lineCount):
file.get_line()