BGGET returns a 16-bit value, where each bit determines information about the BG tile. The first 12 bits will determine the ID of the BG tile, which is probably what you want. You can find information about other bits in the help entry. To get the values of the bits, you can do an AND operation with the return value and a value whose on-bits match the ones you want to get.
For example...
TILE=BGGET(0,10,20,1)
TILEID=TILE AND VAL("&B111111111111")
...will get you the BG tile ID for a BG tile on layer 0 and coordinates <10,20> in terms of screen pixels.